From 34854e7b4c81261230d0e4118b5e70b27c660831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 03:37:53 +0100 Subject: [PATCH] added strip argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- client/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/main.py b/client/main.py index 49ff8ca..aff3da1 100644 --- a/client/main.py +++ b/client/main.py @@ -63,27 +63,27 @@ def update_led_strip(rgb_values, pixel, strip): def on_message(mqttc, obj, msg): if msg.topic == "tube-"+wlan_mac_address+"/p1": for pixel in range(LEDS_PER_PIXEL): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) elif msg.topic == "tube-"+wlan_mac_address+"/p2": for pixel in range(LEDS_PER_PIXEL, LEDS_PER_PIXEL*2): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) elif msg.topic == "tube-"+wlan_mac_address+"/p3": for pixel in range(LEDS_PER_PIXEL*2, LEDS_PER_PIXEL*3): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) elif msg.topic == "tube-"+wlan_mac_address+"/p4": for pixel in range(LEDS_PER_PIXEL*3, LEDS_PER_PIXEL*4): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) elif msg.topic == "tube-"+wlan_mac_address+"/p5": for pixel in range(LEDS_PER_PIXEL*4, LEDS_PER_PIXEL*5): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) elif msg.topic == "tube-"+wlan_mac_address+"/p6": for pixel in range(LEDS_PER_PIXEL*5, LEDS_PER_PIXEL*6): - update_led_strip(list(msg.payload), pixel) + update_led_strip(list(msg.payload), pixel, strip) if __name__ == "__main__": # Connect to Wi-Fi