From 7ee17c7af8715ab28f8da42a030ebdcb60acd154 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Sat, 1 Jul 2023 10:19:14 -0600 Subject: [PATCH] Fix small audio events details (#6978) * Fix missed audio details * Add mqtt docs * Delete instead of setting to None --- docs/docs/configuration/index.md | 5 +++-- docs/docs/integrations/mqtt.md | 12 ++++++++++-- frigate/comms/mqtt.py | 1 + frigate/events/audio.py | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/docs/configuration/index.md b/docs/docs/configuration/index.md index 8915db6b3a..f23a32270a 100644 --- a/docs/docs/configuration/index.md +++ b/docs/docs/configuration/index.md @@ -467,10 +467,11 @@ cameras: # Required: the path to the stream # NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {} - path: rtsp://viewer:{FRIGATE_RTSP_PASSWORD}@10.0.10.10:554/cam/realmonitor?channel=1&subtype=2 - # Required: list of roles for this stream. valid values are: detect,record,rtmp - # NOTICE: In addition to assigning the record and rtmp roles, + # Required: list of roles for this stream. valid values are: audio,detect,record,rtmp + # NOTICE: In addition to assigning the audio, record, and rtmp roles, # they must also be enabled in the camera config. roles: + - audio - detect - record - rtmp diff --git a/docs/docs/integrations/mqtt.md b/docs/docs/integrations/mqtt.md index cde7605590..229285676b 100644 --- a/docs/docs/integrations/mqtt.md +++ b/docs/docs/integrations/mqtt.md @@ -109,11 +109,19 @@ Same data available at `/api/stats` published at a configurable interval. ### `frigate//detect/set` -Topic to turn detection for a camera on and off. Expected values are `ON` and `OFF`. +Topic to turn object detection for a camera on and off. Expected values are `ON` and `OFF`. ### `frigate//detect/state` -Topic with current state of detection for a camera. Published values are `ON` and `OFF`. +Topic with current state of object detection for a camera. Published values are `ON` and `OFF`. + +### `frigate//audio/set` + +Topic to turn audio detection for a camera on and off. Expected values are `ON` and `OFF`. + +### `frigate//audio/state` + +Topic with current state of audio detection for a camera. Published values are `ON` and `OFF`. ### `frigate//recordings/set` diff --git a/frigate/comms/mqtt.py b/frigate/comms/mqtt.py index 4ddfbe7f13..2859a04a2c 100644 --- a/frigate/comms/mqtt.py +++ b/frigate/comms/mqtt.py @@ -149,6 +149,7 @@ def _start(self) -> None: "recordings", "snapshots", "detect", + "audio", "motion", "improve_contrast", "motion_threshold", diff --git a/frigate/events/audio.py b/frigate/events/audio.py index 4f40334d42..e1d25e0188 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -206,7 +206,7 @@ def expire_detections(self) -> None: now - detection.get("last_detection", now) > self.config.audio.max_not_heard ): - self.detections[detection["label"]] = None + del self.detections[detection["label"]] requests.put( f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end", json={