diff --git a/main.py b/main.py index a87a88f..d5d30a1 100644 --- a/main.py +++ b/main.py @@ -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