parent
99d1876dec
commit
d37085eac7
7
main.py
7
main.py
|
@ -94,6 +94,9 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
mode = 0
|
mode = 0
|
||||||
power = "True"
|
power = "True"
|
||||||
|
r = 255
|
||||||
|
g = 255
|
||||||
|
b = 255
|
||||||
|
|
||||||
mqttBroker ="homeassistant.ping-mee.local"
|
mqttBroker ="homeassistant.ping-mee.local"
|
||||||
client = mqtt.Client("server_rack_led")
|
client = mqtt.Client("server_rack_led")
|
||||||
|
@ -114,10 +117,6 @@ if __name__ == '__main__':
|
||||||
rainbowCycle(strip)
|
rainbowCycle(strip)
|
||||||
|
|
||||||
elif mode == 1:
|
elif mode == 1:
|
||||||
try:
|
|
||||||
r
|
|
||||||
except NameError:
|
|
||||||
client.publish("server-rack-led/rgb", "255,0,0")
|
|
||||||
setColor(strip, Color(int(r), int(g), int(b)))
|
setColor(strip, Color(int(r), int(g), int(b)))
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue