mirror of
				https://github.com/Tediore/battery2mqtt.git
				synced 2025-11-04 04:46:35 +01:00 
			
		
		
		
	Add heartbeat
This commit is contained in:
		@@ -132,6 +132,10 @@ def get_info():
 | 
				
			|||||||
                    logging.debug('Sending MQTT payload: ' + str(payload))
 | 
					                    logging.debug('Sending MQTT payload: ' + str(payload))
 | 
				
			||||||
        except Exception as e:
 | 
					        except Exception as e:
 | 
				
			||||||
            logging.error(f'Message send failed: {e}')
 | 
					            logging.error(f'Message send failed: {e}')
 | 
				
			||||||
 | 
					    try:
 | 
				
			||||||
 | 
					        client.publish("battery2mqtt/" + MQTT_TOPIC + '/status', 'online', 0, True)
 | 
				
			||||||
 | 
					    except Exception as e:
 | 
				
			||||||
 | 
					        logging.error(f'Message send failed: {e}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
check_conditions()
 | 
					check_conditions()
 | 
				
			||||||
mqtt_connect()
 | 
					mqtt_connect()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user