parent
cf5e06c192
commit
ca90f36f07
8
main.py
8
main.py
|
@ -201,8 +201,8 @@ if __name__ == '__main__':
|
||||||
client.on_connect = mqtt_on_connect
|
client.on_connect = mqtt_on_connect
|
||||||
client.on_message = mqtt_on_message
|
client.on_message = mqtt_on_message
|
||||||
|
|
||||||
client.publish("server-rack-led/power","True")
|
client.publish("server-rack-led/power", "True")
|
||||||
client.publish("server-rack-led/mode","Rainbow")
|
client.publish("server-rack-led/mode", "Rainbow")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
client.loop_start()
|
client.loop_start()
|
||||||
|
@ -215,9 +215,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
r
|
r
|
||||||
except NameError:
|
except NameError:
|
||||||
r = "255"
|
client.publish("server-rack-led/rgb", "255,0,0")
|
||||||
g = "0"
|
|
||||||
b = "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