From 09bb8857b9794f2e6e0b11de7fd00801c2b3ebd3 Mon Sep 17 00:00:00 2001 From: JP Verdejo Date: Sun, 2 Jul 2023 17:21:07 -0500 Subject: [PATCH] Address feedback --- frigate/comms/dispatcher.py | 5 ++--- frigate/comms/inter_process.py | 1 + frigate/events/audio.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frigate/comms/dispatcher.py b/frigate/comms/dispatcher.py index 08aa0adc9..dd2b2ccc7 100644 --- a/frigate/comms/dispatcher.py +++ b/frigate/comms/dispatcher.py @@ -83,9 +83,8 @@ class Dispatcher: return elif topic == "restart": restart_frigate() - elif "metadata" in topic: - # example /cam_name/metadata/dbfs payload=-55.23 - self.publish(topic, payload, retain=True) + else: + self.publish(topic, payload, retain=False) def publish(self, topic: str, payload: Any, retain: bool = False) -> None: """Handle publishing to communicators.""" diff --git a/frigate/comms/inter_process.py b/frigate/comms/inter_process.py index a81a6b884..ff4a1180a 100644 --- a/frigate/comms/inter_process.py +++ b/frigate/comms/inter_process.py @@ -15,6 +15,7 @@ class InterProcessCommunicator(Communicator): self.stop_event: MpEvent = mp.Event() def publish(self, topic: str, payload: str, retain: bool) -> None: + """There is no communication back to the processes.""" pass def subscribe(self, receiver: Callable) -> None: diff --git a/frigate/events/audio.py b/frigate/events/audio.py index 7055537f4..a4238d9ab 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -197,10 +197,10 @@ class AudioEventMaintainer(threading.Thread): dBFS = 20 * np.log10(np.abs(rms) / AUDIO_MAX_BIT_RANGE) self.inter_process_communicator.queue.put( - (f"{self.config.name}/metadata/dBFS", float(dBFS)) + (f"{self.config.name}/audio/dBFS", float(dBFS)) ) self.inter_process_communicator.queue.put( - (f"{self.config.name}/metadata/rms", float(rms)) + (f"{self.config.name}/audio/rms", float(rms)) ) def handle_detection(self, label: str, score: float) -> None: