aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-12-11 13:37:31 +0100
committerKarel Kočí <cynerd@email.cz>2022-12-11 13:37:31 +0100
commit1a2c69a2152c315a964c0eb9b2673c70e52051b4 (patch)
tree1b4ecd06c4880c6e45bcb3db3c630cc6a2476e32
parente14472f3f5e12774b5b185a718591ef8e5cfe00f (diff)
downloadbigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.tar.gz
bigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.tar.bz2
bigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.zip
Rewrite the topic parsing
-rwxr-xr-xbigclown-leds3
1 files changed, 2 insertions, 1 deletions
diff --git a/bigclown-leds b/bigclown-leds
index 4d635fc..d988bdf 100755
--- a/bigclown-leds
+++ b/bigclown-leds
@@ -12,7 +12,8 @@ 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:]
+ ptopic = msg.topic.split("/")
+ topic = "/".join(ptopic[ptopic.index("led") + 1 :])
if topic == "effect/set":
# Well for now just this way
client.publish(