From ebcd89846d987a311459cf06397762531464e169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 11 Dec 2022 11:14:26 +0100 Subject: bigclown-leds: update the path --- bigclown-leds | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/bigclown-leds b/bigclown-leds index 46b3c88..516515e 100755 --- a/bigclown-leds +++ b/bigclown-leds @@ -3,25 +3,26 @@ import paho.mqtt.client as mqtt def on_connect(client, userdata, flags, rc): - print("Connected with result code "+str(rc)) - client.subscribe("node/lcd-thermostat:0/led/#") + print("Connected with result code " + str(rc)) + client.subscribe("bigclown/node/lcd-thermostat:0/led/#") # The callback for when a PUBLISH message is received from the server. def on_message(client, userdata, msg): topic = msg.topic[26:] - if topic == 'effect/set': + if topic == "effect/set": # Well for now just this way client.publish( - 'node/power-controller:0/led-strip/-/effect/set', - '{"type": "rainbow", "wait":50}') + "bigclown/node/power-controller:0/led-strip/-/effect/set", + '{"type": "rainbow", "wait":50}', + ) else: client.publish( - 'node/power-controller:0/led-strip/-/' + topic, - payload=msg.payload) + "bigclown/node/power-controller:0/led-strip/-/" + topic, payload=msg.payload + ) -#def on_log(mqttc, obj, level, string): +# def on_log(mqttc, obj, level, string): # print(string) @@ -29,11 +30,11 @@ def main(): client = mqtt.Client() client.on_connect = on_connect client.on_message = on_message - #client.on_log = on_log + # client.on_log = on_log client.connect("127.0.0.1", 1883, 60) client.loop_forever() -if __name__ == '__main__': +if __name__ == "__main__": main() -- cgit v1.2.3