From b9bb4a7a65b4e9747540b0bd656ffbb9a851bd6e Mon Sep 17 00:00:00 2001 From: Dieter Tschanz Date: Sun, 20 Oct 2024 18:01:26 +0200 Subject: [PATCH] Fixes to pass test. --- esphome/components/api/api_connection.cpp | 3 ++- esphome/components/esp32_camera/esp32_camera.h | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 06147c20f0..a8c7b0f817 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -41,9 +41,10 @@ APIConnection::APIConnection(std::unique_ptr sock, APIServer *pa #endif #ifdef USE_CAMERA - if (camera::Camera::global_camera != nullptr) + if (camera::Camera::global_camera != nullptr) { this->image_reader_ = std::unique_ptr{camera::Camera::global_camera->create_image_reader()}; + } #endif } void APIConnection::start() { diff --git a/esphome/components/esp32_camera/esp32_camera.h b/esphome/components/esp32_camera/esp32_camera.h index 076866c4e9..9c0f947572 100644 --- a/esphome/components/esp32_camera/esp32_camera.h +++ b/esphome/components/esp32_camera/esp32_camera.h @@ -152,12 +152,12 @@ class ESP32Camera : public Component, public camera::Camera { void dump_config() override; float get_setup_priority() const override; /* public API (specific) */ - void start_stream(camera::CameraRequester requester); - void stop_stream(camera::CameraRequester requester); - void request_image(camera::CameraRequester requester); + void start_stream(camera::CameraRequester requester) override; + void stop_stream(camera::CameraRequester requester) override; + void request_image(camera::CameraRequester requester) override; void update_camera_parameters(); - void add_image_callback(std::function)> &&callback); + void add_image_callback(std::function)> &&callback) override; void add_stream_start_callback(std::function &&callback); void add_stream_stop_callback(std::function &&callback); camera::CameraImageReader *create_image_reader() override;