From ad3d43f0b113a935dbc2259af98be95eb8ab7365 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sat, 1 Jul 2023 15:04:03 -0600 Subject: [PATCH] Fix audio events not being ended --- frigate/events/audio.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frigate/events/audio.py b/frigate/events/audio.py index e1d25e018..b0c55c3a3 100644 --- a/frigate/events/audio.py +++ b/frigate/events/audio.py @@ -202,11 +202,14 @@ class AudioEventMaintainer(threading.Thread): now = datetime.datetime.now().timestamp() for detection in self.detections.values(): + if not detection: + continue + if ( now - detection.get("last_detection", now) > self.config.audio.max_not_heard ): - del self.detections[detection["label"]] + self.detections[detection["label"]] = None requests.put( f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end", json={