From a84f88c5a58ba8049398e3095e06802e010d34f7 Mon Sep 17 00:00:00 2001 From: blakeblackshear Date: Sun, 17 Feb 2019 10:36:09 -0600 Subject: [PATCH] comments --- detect_objects.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/detect_objects.py b/detect_objects.py index f14155cf6..95286d4e8 100644 --- a/detect_objects.py +++ b/detect_objects.py @@ -145,11 +145,13 @@ class MqttPublisher(threading.Thread): if obj['name'] in self.object_classes: payload[obj['name']].append(obj) + # send message for objects new_payload = json.dumps(payload, sort_keys=True) if new_payload != last_sent_payload: last_sent_payload = new_payload self.client.publish(self.topic_prefix+'/objects', new_payload, retain=False) - + + # send message for motion motion_status = 'OFF' if any(obj.value == 1 for obj in self.motion_flags): motion_status = 'ON' @@ -157,7 +159,6 @@ class MqttPublisher(threading.Thread): if motion_status != last_motion: last_motion = motion_status self.client.publish(self.topic_prefix+'/motion', motion_status, retain=False) - time.sleep(0.1)