diff options
author | Karel Kočí <cynerd@email.cz> | 2019-03-06 22:36:22 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2019-03-06 22:40:31 +0100 |
commit | a1236a39e7842ed24b3a9c986dba177d02be5114 (patch) | |
tree | 127ee3ce519961c627fd14e9850e553b502a0205 /bigclown-leds | |
parent | fe2ce269997dcc23f5eac51ee64e2d06570bf6d4 (diff) | |
download | bigclown-leds-a1236a39e7842ed24b3a9c986dba177d02be5114.tar.gz bigclown-leds-a1236a39e7842ed24b3a9c986dba177d02be5114.tar.bz2 bigclown-leds-a1236a39e7842ed24b3a9c986dba177d02be5114.zip |
Implement gui and fix rainbow selection
For some reason when I use " in payload it is not send. I have no idea
why but it is just probably some bug in bigclown.
Diffstat (limited to 'bigclown-leds')
-rwxr-xr-x | bigclown-leds | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bigclown-leds b/bigclown-leds index 9bb3b0b..29d2e31 100755 --- a/bigclown-leds +++ b/bigclown-leds @@ -10,9 +10,15 @@ def on_connect(client, userdata, flags, rc): # The callback for when a PUBLISH message is received from the server. def on_message(client, userdata, msg): topic = msg.topic[26:] - client.publish( - 'node/power-controller:0/led-strip/-/' + topic, - payload=msg.payload) + if topic == 'effect/set': + # Well for now just this way + client.publish( + '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) #def on_log(mqttc, obj, level, string): |