Make sure multiple True values aren't published for the same motion

This commit is contained in:
Nick Mowen 2022-05-12 16:30:54 -06:00
parent 4d81a08597
commit 2b35cf8f9b

View File

@ -849,7 +849,7 @@ class TrackedObjectProcessor(threading.Thread):
# publish if motion is currently being detected
if motion_boxes:
# only send True if motion hasn't been detected recently
if self.last_motion_updates[camera] == 0:
if self.last_motion_updates.get(camera, 0) == 0:
self.client.publish(
f"{self.topic_prefix}/{camera}/motion/detected",
True,