From d37085eac70a2b9bf1d9ece71f982eca1290f109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 2 Jul 2022 09:28:12 +0200 Subject: [PATCH] added rgb def fix 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, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 066879d..5cbe4a2 100644 --- a/main.py +++ b/main.py @@ -94,6 +94,9 @@ if __name__ == '__main__': mode = 0 power = "True" + r = 255 + g = 255 + b = 255 mqttBroker ="homeassistant.ping-mee.local" client = mqtt.Client("server_rack_led") @@ -114,10 +117,6 @@ if __name__ == '__main__': rainbowCycle(strip) elif mode == 1: - try: - r - except NameError: - client.publish("server-rack-led/rgb", "255,0,0") setColor(strip, Color(int(r), int(g), int(b))) time.sleep(1) else: