aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2019-03-06 19:15:32 +0100
committerKarel Kočí <cynerd@email.cz>2019-03-06 22:38:02 +0100
commit987bc4182be8e37ca3d2df66f9d963f19c72413b (patch)
treedce26a8c4e433f00c0bbc92d47153eb359cf998d
parentc54f47138d909bbc5e18fb909ee4d7a62c818f9c (diff)
downloadbigclown-leds-987bc4182be8e37ca3d2df66f9d963f19c72413b.tar.gz
bigclown-leds-987bc4182be8e37ca3d2df66f9d963f19c72413b.tar.bz2
bigclown-leds-987bc4182be8e37ca3d2df66f9d963f19c72413b.zip
bigclown-leds: fix to support new version of paho-mqtt
-rwxr-xr-xbigclown-leds7
1 files changed, 6 insertions, 1 deletions
diff --git a/bigclown-leds b/bigclown-leds
index 2871d52..9bb3b0b 100755
--- a/bigclown-leds
+++ b/bigclown-leds
@@ -2,7 +2,7 @@
import paho.mqtt.client as mqtt
-def on_connect(client, userdata, rc):
+def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
client.subscribe("node/lcd-thermostat:0/led/#")
@@ -15,10 +15,15 @@ def on_message(client, userdata, msg):
payload=msg.payload)
+#def on_log(mqttc, obj, level, string):
+# print(string)
+
+
def main():
client = mqtt.Client()
client.on_connect = on_connect
client.on_message = on_message
+ #client.on_log = on_log
client.connect("127.0.0.1", 1883, 60)
client.loop_forever()