parent
9d43ea6ae1
commit
de6acca1eb
3
main.py
3
main.py
|
@ -134,12 +134,14 @@ if __name__ == '__main__':
|
||||||
topic = str(msg.topic)
|
topic = str(msg.topic)
|
||||||
payload = str(msg.payload.decode("utf-8"))
|
payload = str(msg.payload.decode("utf-8"))
|
||||||
if topic == "server-rack-led/power":
|
if topic == "server-rack-led/power":
|
||||||
|
client.publish("server-rack-led/power/status", str(payload))
|
||||||
global power
|
global power
|
||||||
power = payload
|
power = payload
|
||||||
global singleExecute
|
global singleExecute
|
||||||
singleExecute = True
|
singleExecute = True
|
||||||
|
|
||||||
elif topic == "server-rack-led/rgb":
|
elif topic == "server-rack-led/rgb":
|
||||||
|
client.publish("server-rack-led/rgb/status", str(payload))
|
||||||
splitted_payload = payload.split(",")
|
splitted_payload = payload.split(",")
|
||||||
global r
|
global r
|
||||||
r = str(splitted_payload[0])
|
r = str(splitted_payload[0])
|
||||||
|
@ -149,6 +151,7 @@ if __name__ == '__main__':
|
||||||
b = str(splitted_payload[2])
|
b = str(splitted_payload[2])
|
||||||
|
|
||||||
elif topic == "server-rack-led/mode":
|
elif topic == "server-rack-led/mode":
|
||||||
|
client.publish("server-rack-led/mode/status", str(payload))
|
||||||
if payload == "Rainbow":
|
if payload == "Rainbow":
|
||||||
global mode
|
global mode
|
||||||
mode = 0
|
mode = 0
|
||||||
|
|
Loading…
Reference in New Issue