mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Address feedback
This commit is contained in:
parent
0d3d78a695
commit
09bb8857b9
@ -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."""
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user