mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-09-23 17:52:05 +02:00
Support all audio type in MQTT (#19768)
* Support all audio type in MQTT * Formatting
This commit is contained in:
parent
6c3f99150c
commit
195f705616
@ -279,6 +279,8 @@ The height and crop of snapshots can be configured in the config.
|
|||||||
|
|
||||||
Publishes "ON" when a type of audio is detected and "OFF" when it is not for the camera for use as a sensor in Home Assistant.
|
Publishes "ON" when a type of audio is detected and "OFF" when it is not for the camera for use as a sensor in Home Assistant.
|
||||||
|
|
||||||
|
`all` can be used as the audio_type for the status of all audio types.
|
||||||
|
|
||||||
### `frigate/<camera_name>/audio/dBFS`
|
### `frigate/<camera_name>/audio/dBFS`
|
||||||
|
|
||||||
Publishes the dBFS value for audio detected on this camera.
|
Publishes the dBFS value for audio detected on this camera.
|
||||||
|
@ -181,6 +181,10 @@ class AudioActivityManager:
|
|||||||
new_detections = new_activity[camera].get("detections", [])
|
new_detections = new_activity[camera].get("detections", [])
|
||||||
if self.compare_audio_activity(camera, new_detections, now):
|
if self.compare_audio_activity(camera, new_detections, now):
|
||||||
logger.debug(f"Audio detections for {camera}: {new_activity}")
|
logger.debug(f"Audio detections for {camera}: {new_activity}")
|
||||||
|
self.publish(
|
||||||
|
f"{camera}/audio/all",
|
||||||
|
"ON" if len(self.current_audio_detections[camera]) > 0 else "OFF",
|
||||||
|
)
|
||||||
self.publish(
|
self.publish(
|
||||||
"audio_detections",
|
"audio_detections",
|
||||||
json.dumps(self.current_audio_detections),
|
json.dumps(self.current_audio_detections),
|
||||||
|
Loading…
Reference in New Issue
Block a user