added status publish

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-12-27 19:36:58 +01:00
parent 9d43ea6ae1
commit de6acca1eb
1 changed files with 3 additions and 0 deletions

View File

@ -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