str from in str to eval list

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-17 13:53:20 +01:00
parent 35232f2758
commit a71eca41fd
1 changed files with 2 additions and 4 deletions

View File

@ -62,14 +62,12 @@ def update_led_strip(rgb_values, pixel, strip):
strip[int(pixel)] = rgb_values strip[int(pixel)] = rgb_values
def on_message(mqttc, obj, msg): def on_message(mqttc, obj, msg):
rgb_values_list = msg.payload.decode() rgb_values_list = eval(msg.payload.decode())
print(eval(rgb_values_list))
time.sleep(1) time.sleep(1)
# print(list(*rgb_values_list[0])) print(eval(rgb_values_list[0]))
# for pixel in range(LEDS_PER_PIXEL): # for pixel in range(LEDS_PER_PIXEL):
# update_led_strip(tuple(*rgb_values_list[0]), pixel, strip) # update_led_strip(tuple(*rgb_values_list[0]), pixel, strip)