parent
0f8c300a32
commit
73a0f3c799
|
@ -59,14 +59,14 @@ def is_connected_to_wifi():
|
|||
return output.split('"')[1]
|
||||
|
||||
def update_led_strip(rgb_values, pixel, strip):
|
||||
print(pixel)
|
||||
print(rgb_values)
|
||||
strip[int(pixel)] = rgb_values
|
||||
|
||||
def on_message(mqttc, obj, msg):
|
||||
rgb_values_list = eval(msg.payload.decode())
|
||||
|
||||
for pixel in range(LEDS_PER_PIXEL):
|
||||
print("Updating pixel "+str(pixel)+" with values: ")
|
||||
print(tuple(eval(rgb_values_list[0])))
|
||||
update_led_strip(tuple(eval(rgb_values_list[0])), pixel, strip)
|
||||
|
||||
for pixel in range(LEDS_PER_PIXEL, LEDS_PER_PIXEL*2):
|
||||
|
|
Loading…
Reference in New Issue