1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-14 09:12:19 +01:00

Introduce base Camera class to support alternative camera implementations

This commit introduces a new 'Camera' base class positioned between the
API layer and the existing 'ESP32Camera' implementation.
- No changes to functionality in 'ESP32Camera' or
'ESP32CameraWebServer'.
- This refactoring enables future camera implementations to integrate
with the existing API.
- The goal is to keep the commit as minimal and non-breaking as
possible.

This is the first step in a series of changes aimed at modernizing and
generalizing ESPHome's camera support.
This commit is contained in:
Dieter Tschanz
2025-07-01 19:47:50 +02:00
parent aaa7117ec9
commit d209739f85
21 changed files with 230 additions and 128 deletions

View File

@@ -204,7 +204,7 @@ void APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type,
this->on_execute_service_request(msg);
break;
}
#ifdef USE_ESP32_CAMERA
#ifdef USE_CAMERA
case 45: {
CameraImageRequest msg;
msg.decode(msg_data, msg_size);
@@ -682,7 +682,7 @@ void APIServerConnection::on_button_command_request(const ButtonCommandRequest &
}
}
#endif
#ifdef USE_ESP32_CAMERA
#ifdef USE_CAMERA
void APIServerConnection::on_camera_image_request(const CameraImageRequest &msg) {
if (this->check_authenticated_()) {
this->camera_image(msg);