Skip to content

Commit

Permalink
fix for offline message even after reconnect #57
Browse files Browse the repository at this point in the history
closes #57
  • Loading branch information
Sennevds authored Sep 27, 2020
1 parent 377410c commit 370d621
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/system_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def on_connect(client, userdata, flags, rc):
if rc == 0:
write_message_to_console("Connected to broker")
client.subscribe("hass/status")
mqttClient.publish(f"system-sensors/sensor/{deviceName}/availability", "online", retain=True)
else:
write_message_to_console("Connection failed")

Expand Down

0 comments on commit 370d621

Please sign in to comment.