mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	comments
This commit is contained in:
		
							parent
							
								
									2b0ebfa354
								
							
						
					
					
						commit
						a84f88c5a5
					
				@ -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'
 | 
			
		||||
@ -158,7 +160,6 @@ class MqttPublisher(threading.Thread):
 | 
			
		||||
                last_motion = motion_status
 | 
			
		||||
                self.client.publish(self.topic_prefix+'/motion', motion_status, retain=False)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            time.sleep(0.1)
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user