From b3a0e08cdb22bac68573a92a8b4e9aba13c4d24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 1 Jul 2022 22:42:07 +0200 Subject: [PATCH] removed topic decode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f9add58..b97e8fb 100644 --- a/main.py +++ b/main.py @@ -68,9 +68,9 @@ def mqtt_on_connect(client, userdata, flags, rc): client.subscribe("server-rack-led-1/b") def mqtt_on_message(client, userdata, msg): - print("topic: " ,str(msg.topic.decode("utf-8"))) + print("topic: " ,str(msg.topic)) print("payload: " ,str(msg.payload.decode("utf-8"))) - topic = str(msg.topic.decode("utf-8")) + topic = str(msg.topic) payload = str(msg.payload.decode("utf-8")) if topic == "server-rack-led-1/power": power = payload