From 5ba4ca8d8e416a39d4c0b6b19132241d4dc84a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Fri, 1 Jul 2022 23:22:50 +0200 Subject: [PATCH] changed mothode to get colors for mode 2 with new topic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index ce8ede5..c672fe8 100644 --- a/main.py +++ b/main.py @@ -169,8 +169,13 @@ if __name__ == '__main__': power = payload elif topic == "server-rack-led/rgb": + json_payload = json.loads(dict(payload)) global r - r = payload + r = str(json_payload["r"]) + global g + g = str(json_payload["g"]) + global b + b = str(json_payload["b"]) elif topic == "server-rack-led/mode": if payload == "0":