ESPHome 2026.5.0b1
Loading...
Searching...
No Matches
camera.cpp
Go to the documentation of this file.
1#include "camera.h"
2
3namespace esphome::camera {
4
5// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
6Camera *Camera::global_camera = nullptr;
7
9 if (global_camera != nullptr) {
10 this->status_set_error(LOG_STR("Multiple cameras are configured, but only one is supported."));
11 this->mark_failed();
12 return;
13 }
14
15 global_camera = this;
16}
17
19
20} // namespace esphome::camera
void mark_failed()
Mark this component as failed.
Abstract camera base class.
Definition camera.h:114
static Camera * instance()
The singleton instance of the camera implementation.
Definition camera.cpp:18
static Camera * global_camera
Definition camera.h:133