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()