added flask baxk and removed client loop thread and put client-loop in while loop
Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>master
parent
d493b6a9ec
commit
e0a8552f26
5
main.py
5
main.py
|
@ -92,7 +92,7 @@ def mqtt_on_message(client, userdata, msg):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
#api
|
#api
|
||||||
@app.route('/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/power","True")
|
||||||
client.publish("server-rack-led-1/mode","0")
|
client.publish("server-rack-led-1/mode","0")
|
||||||
|
|
||||||
threading.Thread(target=lambda: client.loop_forever())
|
# threading.Thread(target=lambda: client.loop_forever())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while True:
|
while True:
|
||||||
|
client.loop_forever()
|
||||||
if power == "True":
|
if power == "True":
|
||||||
if mode == 0:
|
if mode == 0:
|
||||||
rainbowCycle(strip)
|
rainbowCycle(strip)
|
||||||
|
|
Loading…
Reference in New Issue