From f500ee02ae96abb6fd03dfc6e6e281dc71aa2d99 Mon Sep 17 00:00:00 2001 From: marcsello Date: Wed, 30 Sep 2020 05:09:09 +0200 Subject: [PATCH] Swapped led colors --- birbnetes_iot_platform_raspberry/led_stuff.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/birbnetes_iot_platform_raspberry/led_stuff.py b/birbnetes_iot_platform_raspberry/led_stuff.py index 98bba17..3340b16 100644 --- a/birbnetes_iot_platform_raspberry/led_stuff.py +++ b/birbnetes_iot_platform_raspberry/led_stuff.py @@ -52,15 +52,11 @@ class BlinkenLight: class BlinkenLights(Thread): - LED_TARGETS = { - 'red': 23, - 'green': 24 - } - def __init__(self): + def __init__(self, targets: dict): super().__init__() self._led_controllers = {} - for name, pin in self.LED_TARGETS.items(): + for name, pin in targets.items(): self._led_controllers[name] = BlinkenLight(pin) self._active = True @@ -82,12 +78,11 @@ class BlinkenLights(Thread): class BirbnetesIoTPlatformStatusDriver: - blinken_lights = None @classmethod def init(cls): - cls.blinken_lights = BlinkenLights() + cls.blinken_lights = BlinkenLights({'red': 24, 'green': 23}) cls.blinken_lights.start() @classmethod