From bd0d16a75b56c02690fbb4d1949ace51fa0629fc Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 1 Sep 2023 06:06:59 -0600 Subject: [PATCH] Set commands before subscribing to messages (#7550) --- frigate/comms/dispatcher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index 56a2c5c9b..e97095c8a 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -52,9 +52,6 @@ class Dispatcher: self.ptz_metrics = ptz_metrics self.comms = communicators - for comm in self.comms: - comm.subscribe(self._receive) - self._camera_settings_handlers: dict[str, Callable] = { "audio": self._on_audio_command, "detect": self._on_detect_command, @@ -67,6 +64,9 @@ class Dispatcher: "snapshots": self._on_snapshots_command, } + for comm in self.comms: + comm.subscribe(self._receive) + def _receive(self, topic: str, payload: str) -> None: """Handle receiving of payload from communicators.""" if topic.endswith("set"):