parent
e0a8552f26
commit
33b9d87bc6
6
main.py
6
main.py
|
@ -205,11 +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_start())
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
client.loop_start()
|
||||||
while True:
|
while True:
|
||||||
client.loop_forever()
|
|
||||||
if power == "True":
|
if power == "True":
|
||||||
if mode == 0:
|
if mode == 0:
|
||||||
rainbowCycle(strip)
|
rainbowCycle(strip)
|
||||||
|
@ -223,6 +223,6 @@ if __name__ == '__main__':
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
client.disconnect()
|
client.loop_stop()
|
||||||
setColor(strip, Color(0,0,0))
|
setColor(strip, Color(0,0,0))
|
||||||
GPIO.cleanup()
|
GPIO.cleanup()
|
||||||
|
|
Loading…
Reference in New Issue