added global vars to mqtt_on_message

Signed-off-by: Ebbe Baß <ebbe@ping-mee.de>
master
Ebbe Baß 2022-07-01 22:55:57 +02:00
parent cf5224c8a3
commit f31f971e63
1 changed files with 5 additions and 0 deletions

View File

@ -168,19 +168,24 @@ if __name__ == '__main__':
topic = str(msg.topic)
payload = str(msg.payload.decode("utf-8"))
if topic == "server-rack-led-1/power":
global power
power = payload
elif topic == "server-rack-led-1/r":
global r
r = payload
elif topic == "server-rack-led-1/g":
global g
g = payload
elif topic == "server-rack-led-1/b":
global b
b = payload
elif topic == "server-rack-led-1/mode":
if payload == "0":
global mode
mode = 0
elif payload == "1":
mode = 1