mirror of
https://github.com/Tediore/battery2mqtt.git
synced 2025-04-12 03:13:43 +02:00
Add heartbeat
This commit is contained in:
parent
2d2642d7f9
commit
0405d5600e
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user