From 7c18a6e1c3be6e93de5a4dcb6b55c9b8b8998f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 2 Jul 2022 10:31:26 +0200 Subject: [PATCH] removed animation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 8f03a64..044c538 100644 --- a/main.py +++ b/main.py @@ -35,20 +35,18 @@ def debug_print(message: str): current_time = now.strftime("%H:%M:%S") print('[DEBUG]['+current_time+'] '+message) -def wheel(client, pos): +def wheel(pos): if pos < 85: - # client.publish("server-rack-led/rgb", str(pos * 3)+","+str(255 - pos * 3)+","+str(0)) return Color(pos * 3, 255 - pos * 3, 0) elif pos < 170: pos -= 85 - # client.publish("server-rack-led/rgb", str(255 - pos * 3)+","+str(0)+","+str(pos * 3)) return Color(255 - pos * 3, 0, pos * 3) else: pos -= 170 client.publish("server-rack-led/rgb", str(0)+","+str(pos * 3)+","+str(255 - pos * 3)) return Color(0, pos * 3, 255 - pos * 3) -def rainbowCycle(client, strip, wait_ms=5, iterations=10): +def rainbowCycle( strip, wait_ms=5, iterations=10): for j in range(256*iterations): if mode > 0: break @@ -126,7 +124,7 @@ if __name__ == '__main__': while True: if power == "True": if mode == 0: - rainbowCycle(client, strip) + rainbowCycle(strip) elif mode == 1: setColor(strip, Color(int(r), int(g), int(b))) time.sleep(1)