Fix small audio events details (#6978)

* Fix missed audio details

* Add mqtt docs

* Delete instead of setting to None
This commit is contained in:
Nicolas Mowen 2023-07-01 10:19:14 -06:00 committed by GitHub
parent c3b313a70d
commit 7ee17c7af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 5 deletions

View File

@ -467,10 +467,11 @@ cameras:
# Required: the path to the stream # Required: the path to the stream
# NOTE: path may include environment variables, which must begin with 'FRIGATE_' and be referenced in {} # 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 - 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 # Required: list of roles for this stream. valid values are: audio,detect,record,rtmp
# NOTICE: In addition to assigning the record and rtmp roles, # NOTICE: In addition to assigning the audio, record, and rtmp roles,
# they must also be enabled in the camera config. # they must also be enabled in the camera config.
roles: roles:
- audio
- detect - detect
- record - record
- rtmp - rtmp

View File

@ -109,11 +109,19 @@ Same data available at `/api/stats` published at a configurable interval.
### `frigate/<camera_name>/detect/set` ### `frigate/<camera_name>/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/<camera_name>/detect/state` ### `frigate/<camera_name>/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/<camera_name>/audio/set`
Topic to turn audio detection for a camera on and off. Expected values are `ON` and `OFF`.
### `frigate/<camera_name>/audio/state`
Topic with current state of audio detection for a camera. Published values are `ON` and `OFF`.
### `frigate/<camera_name>/recordings/set` ### `frigate/<camera_name>/recordings/set`

View File

@ -149,6 +149,7 @@ class MqttClient(Communicator): # type: ignore[misc]
"recordings", "recordings",
"snapshots", "snapshots",
"detect", "detect",
"audio",
"motion", "motion",
"improve_contrast", "improve_contrast",
"motion_threshold", "motion_threshold",

View File

@ -206,7 +206,7 @@ class AudioEventMaintainer(threading.Thread):
now - detection.get("last_detection", now) now - detection.get("last_detection", now)
> self.config.audio.max_not_heard > self.config.audio.max_not_heard
): ):
self.detections[detection["label"]] = None del self.detections[detection["label"]]
requests.put( requests.put(
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end", f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
json={ json={