aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-12-11 11:14:26 +0100
committerKarel Kočí <cynerd@email.cz>2022-12-11 11:14:26 +0100
commitebcd89846d987a311459cf06397762531464e169 (patch)
treeece8e9209b51440a169712d57de8c587cee59417
parent000c20d71a54bd6a0914e696fc88b4161c17c45d (diff)
downloadbigclown-leds-ebcd89846d987a311459cf06397762531464e169.tar.gz
bigclown-leds-ebcd89846d987a311459cf06397762531464e169.tar.bz2
bigclown-leds-ebcd89846d987a311459cf06397762531464e169.zip
bigclown-leds: update the path
-rwxr-xr-xbigclown-leds21
1 files 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()