From 5f8ab10325bd888fced25b569f52bd9fcb317f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 2 Jul 2022 10:18:34 +0200 Subject: [PATCH] preped rainbow animation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index d1296dd..be8dad8 100644 --- a/main.py +++ b/main.py @@ -87,7 +87,7 @@ if __name__ == '__main__': mode = 0 elif payload == "Custom Color": mode = 1 - + client.publish("server-rack-led/rgb", "255,255,255") strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL) strip.begin() @@ -118,7 +118,10 @@ if __name__ == '__main__': if power == "True": if mode == 0: rainbowCycle(client, strip) - + animation_r = 255 + animation_g = 0 + animation_b = 0 + client.publish("server-rack-led/rgb", str(animation_r)+","+str(animation_g)+","+str(animation_b)) elif mode == 1: setColor(strip, Color(int(r), int(g), int(b))) time.sleep(1)