diff --git a/frigate/app.py b/frigate/app.py index 9d60d2a08..fef37813a 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -352,7 +352,9 @@ class FrigateApp: ) def init_profile_manager(self) -> None: - self.profile_manager = ProfileManager(self.config, self.inter_config_updater) + self.profile_manager = ProfileManager( + self.config, self.inter_config_updater, self.dispatcher + ) self.dispatcher.profile_manager = self.profile_manager persisted = ProfileManager.load_persisted_profile() diff --git a/frigate/config/profile_manager.py b/frigate/config/profile_manager.py index 37dc1c909..f60cd9a03 100644 --- a/frigate/config/profile_manager.py +++ b/frigate/config/profile_manager.py @@ -42,11 +42,13 @@ class ProfileManager: self, config, config_updater: CameraConfigUpdatePublisher, + dispatcher=None, ): from frigate.config.config import FrigateConfig self.config: FrigateConfig = config self.config_updater = config_updater + self.dispatcher = dispatcher self._base_configs: dict[str, dict[str, dict]] = {} self._base_api_configs: dict[str, dict[str, dict]] = {} self._base_enabled: dict[str, bool] = {} @@ -266,6 +268,12 @@ class ProfileManager: ), cam_config.enabled, ) + if self.dispatcher is not None: + self.dispatcher.publish( + f"{cam_name}/enabled/state", + "ON" if cam_config.enabled else "OFF", + retain=True, + ) continue if section == "zones":