From a71eca41fd1b88fb313b2d43f1d03a0eb4cf6e09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 13:53:20 +0100 Subject: [PATCH] str from in str to eval list MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- client/main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/main.py b/client/main.py index 97b89b8..53fa43e 100644 --- a/client/main.py +++ b/client/main.py @@ -62,14 +62,12 @@ def update_led_strip(rgb_values, pixel, strip): strip[int(pixel)] = rgb_values def on_message(mqttc, obj, msg): - rgb_values_list = msg.payload.decode() - - print(eval(rgb_values_list)) + rgb_values_list = eval(msg.payload.decode()) time.sleep(1) - # print(list(*rgb_values_list[0])) + print(eval(rgb_values_list[0])) # for pixel in range(LEDS_PER_PIXEL): # update_led_strip(tuple(*rgb_values_list[0]), pixel, strip)