mirror of
https://github.com/esphome/esphome.git
synced 2025-09-13 00:32:20 +01:00
Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: J. Nick Koston <nick+github@koston.org>
23 lines
487 B
C++
23 lines
487 B
C++
#include "camera.h"
|
|
|
|
namespace esphome {
|
|
namespace camera {
|
|
|
|
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
|
|
Camera *Camera::global_camera = nullptr;
|
|
|
|
Camera::Camera() {
|
|
if (global_camera != nullptr) {
|
|
this->status_set_error("Multiple cameras are configured, but only one is supported.");
|
|
this->mark_failed();
|
|
return;
|
|
}
|
|
|
|
global_camera = this;
|
|
}
|
|
|
|
Camera *Camera::instance() { return global_camera; }
|
|
|
|
} // namespace camera
|
|
} // namespace esphome
|