diff --git a/esphome/components/camera/camera.cpp b/esphome/components/camera/camera.cpp index becf3fee2e..1e2f4397f7 100644 --- a/esphome/components/camera/camera.cpp +++ b/esphome/components/camera/camera.cpp @@ -3,6 +3,7 @@ namespace esphome { namespace camera { +// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) Camera *Camera::global_camera = nullptr; Camera::Camera() { global_camera = this; } diff --git a/esphome/components/camera/camera.h b/esphome/components/camera/camera.h index 0515b7396a..08ae637eb4 100644 --- a/esphome/components/camera/camera.h +++ b/esphome/components/camera/camera.h @@ -69,6 +69,7 @@ class Camera : public EntityBase { virtual void stop_stream(CameraRequester requester) = 0; virtual ~Camera() {} /// The singleton instance of the camera implementation. + // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) static Camera *global_camera; };