diff options
author | Karel Kočí <cynerd@email.cz> | 2022-12-11 13:37:31 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-12-11 13:37:31 +0100 |
commit | 1a2c69a2152c315a964c0eb9b2673c70e52051b4 (patch) | |
tree | 1b4ecd06c4880c6e45bcb3db3c630cc6a2476e32 | |
parent | e14472f3f5e12774b5b185a718591ef8e5cfe00f (diff) | |
download | bigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.tar.gz bigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.tar.bz2 bigclown-leds-1a2c69a2152c315a964c0eb9b2673c70e52051b4.zip |
Rewrite the topic parsing
-rwxr-xr-x | bigclown-leds | 3 |
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( |