From 33b9d87bc6c2064dcf847458fcba4ddf14ad25b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 1 Jul 2022 22:46:56 +0200 Subject: [PATCH] changed loop methode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index f4e182c..1141a06 100644 --- a/main.py +++ b/main.py @@ -205,11 +205,11 @@ if __name__ == '__main__': client.publish("server-rack-led-1/power","True") client.publish("server-rack-led-1/mode","0") - # threading.Thread(target=lambda: client.loop_forever()) + # threading.Thread(target=lambda: client.loop_start()) try: + client.loop_start() while True: - client.loop_forever() if power == "True": if mode == 0: rainbowCycle(strip) @@ -223,6 +223,6 @@ if __name__ == '__main__': time.sleep(1) except KeyboardInterrupt: - client.disconnect() + client.loop_stop() setColor(strip, Color(0,0,0)) GPIO.cleanup()