mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
Address feedback
This commit is contained in:
parent
0d3d78a695
commit
09bb8857b9
@ -83,9 +83,8 @@ class Dispatcher:
|
|||||||
return
|
return
|
||||||
elif topic == "restart":
|
elif topic == "restart":
|
||||||
restart_frigate()
|
restart_frigate()
|
||||||
elif "metadata" in topic:
|
else:
|
||||||
# example /cam_name/metadata/dbfs payload=-55.23
|
self.publish(topic, payload, retain=False)
|
||||||
self.publish(topic, payload, retain=True)
|
|
||||||
|
|
||||||
def publish(self, topic: str, payload: Any, retain: bool = False) -> None:
|
def publish(self, topic: str, payload: Any, retain: bool = False) -> None:
|
||||||
"""Handle publishing to communicators."""
|
"""Handle publishing to communicators."""
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class InterProcessCommunicator(Communicator):
|
|||||||
self.stop_event: MpEvent = mp.Event()
|
self.stop_event: MpEvent = mp.Event()
|
||||||
|
|
||||||
def publish(self, topic: str, payload: str, retain: bool) -> None:
|
def publish(self, topic: str, payload: str, retain: bool) -> None:
|
||||||
|
"""There is no communication back to the processes."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def subscribe(self, receiver: Callable) -> None:
|
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)
|
dBFS = 20 * np.log10(np.abs(rms) / AUDIO_MAX_BIT_RANGE)
|
||||||
|
|
||||||
self.inter_process_communicator.queue.put(
|
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(
|
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:
|
def handle_detection(self, label: str, score: float) -> None:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user