From 1a2c69a2152c315a964c0eb9b2673c70e52051b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 11 Dec 2022 13:37:31 +0100 Subject: Rewrite the topic parsing --- bigclown-leds | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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( -- cgit v1.2.3