diff --git a/main.py b/main.py index 89a9352..f4e182c 100644 --- a/main.py +++ b/main.py @@ -92,7 +92,7 @@ def mqtt_on_message(client, userdata, msg): if __name__ == '__main__': - # app = Flask(__name__) + app = Flask(__name__) #api @app.route('/api/') @@ -205,10 +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_forever()) try: while True: + client.loop_forever() if power == "True": if mode == 0: rainbowCycle(strip)