From 56e783a763d12c3812385f1a5059f67f5aca212e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 04:03:47 +0100 Subject: [PATCH] first to list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- client/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/main.py b/client/main.py index e3fcc3c..9306865 100644 --- a/client/main.py +++ b/client/main.py @@ -9,6 +9,7 @@ import paho.mqtt.client as mqtt from getmac import get_mac_address import board import sys +import ast SERVER_IP = '192.168.0.1' SERVER_PORT = 5000 @@ -63,7 +64,7 @@ def update_led_strip(rgb_values, pixel, strip): print("Updated pixel "+str(pixel)+" with "+str(rgb_values)) def on_message(mqttc, obj, msg): - rgb_values = (*msg.payload.decode(), ) + rgb_values = (*ast.literal_eval(msg.payload.decode()), ) if msg.topic == "tube-"+wlan_mac_address+"/p1": for pixel in range(LEDS_PER_PIXEL): update_led_strip(rgb_values, pixel, strip)