Address feedback

This commit is contained in:
JP Verdejo 2023-07-02 17:21:07 -05:00
parent 0d3d78a695
commit 09bb8857b9
3 changed files with 5 additions and 5 deletions

View File

@ -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."""

View File

@ -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:

View File

@ -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: