From 987bc4182be8e37ca3d2df66f9d963f19c72413b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 6 Mar 2019 19:15:32 +0100 Subject: bigclown-leds: fix to support new version of paho-mqtt --- bigclown-leds | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3