mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +03:00
Fix audio events not being ended
This commit is contained in:
parent
7ee17c7af8
commit
ad3d43f0b1
@ -202,11 +202,14 @@ class AudioEventMaintainer(threading.Thread):
|
|||||||
now = datetime.datetime.now().timestamp()
|
now = datetime.datetime.now().timestamp()
|
||||||
|
|
||||||
for detection in self.detections.values():
|
for detection in self.detections.values():
|
||||||
|
if not detection:
|
||||||
|
continue
|
||||||
|
|
||||||
if (
|
if (
|
||||||
now - detection.get("last_detection", now)
|
now - detection.get("last_detection", now)
|
||||||
> self.config.audio.max_not_heard
|
> self.config.audio.max_not_heard
|
||||||
):
|
):
|
||||||
del self.detections[detection["label"]]
|
self.detections[detection["label"]] = None
|
||||||
requests.put(
|
requests.put(
|
||||||
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
|
f"{FRIGATE_LOCALHOST}/api/events/{detection['id']}/end",
|
||||||
json={
|
json={
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user