From 132cdce7e0b3e1a927915e966757d150b0ce5526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 13:25:57 +0100 Subject: [PATCH] added rgb_values_list to updater MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- client/main.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/client/main.py b/client/main.py index b12da6a..0ecf5d6 100644 --- a/client/main.py +++ b/client/main.py @@ -63,25 +63,24 @@ def update_led_strip(rgb_values, pixel, strip): def on_message(mqttc, obj, msg): rgb_values_list = msg.payload.decode() - print(rgb_values_list) - # for pixel in range(LEDS_PER_PIXEL): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL): + update_led_strip(rgb_values_list[0], pixel, strip) - # for pixel in range(LEDS_PER_PIXEL, LEDS_PER_PIXEL*2): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL, LEDS_PER_PIXEL*2): + update_led_strip(rgb_values_list[1], pixel, strip) - # for pixel in range(LEDS_PER_PIXEL*2, LEDS_PER_PIXEL*3): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL*2, LEDS_PER_PIXEL*3): + update_led_strip(rgb_values_list[2], pixel, strip) - # for pixel in range(LEDS_PER_PIXEL*3, LEDS_PER_PIXEL*4): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL*3, LEDS_PER_PIXEL*4): + update_led_strip(rgb_values_list[3], pixel, strip) - # for pixel in range(LEDS_PER_PIXEL*4, LEDS_PER_PIXEL*5): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL*4, LEDS_PER_PIXEL*5): + update_led_strip(rgb_values_list[4], pixel, strip) - # for pixel in range(LEDS_PER_PIXEL*5, LEDS_PER_PIXEL*6): - # update_led_strip(rgb_values, pixel, strip) + for pixel in range(LEDS_PER_PIXEL*5, LEDS_PER_PIXEL*6): + update_led_strip(rgb_values_list[5], pixel, strip) if __name__ == "__main__": # Connect to Wi-Fi