Permalink
Browse files

In the event of a succesfull connection, publish state

  • Loading branch information...
kylegordon committed Sep 26, 2012
1 parent 87affcd commit a7ff280af7ee7ff0378d719867e944974a67416b
Showing with 4 additions and 3 deletions.
  1. +4 −3 mqtt-republisher.py
View
@@ -56,10 +56,11 @@ def on_connect(result_code):
"""
## FIXME - needs fleshing out http://mosquitto.org/documentation/python/
if result_code == 0:
- logging.info("Connected to broker")
+ logging.info("Connected to broker")
+ mqttc.publish("/status" + socket.fqdn(), "Online")
else:
- logging.warning("Something went wrong")
- cleanup()
+ logging.warning("Something went wrong")
+ cleanup()
def on_disconnect(result_code):
"""

0 comments on commit a7ff280

Please sign in to comment.