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