diff --git a/blup/output.py b/blup/output.py index 6837631..0cd809a 100644 --- a/blup/output.py +++ b/blup/output.py @@ -331,10 +331,10 @@ class BLPOutput(Output): # class BlinkenbuntHDOutput(Output): - moduleRegexDesc = 'bbunthd' - moduleRegex = '^bbunthd$' + moduleRegexDesc = 'bbunthd[:BRIGHTNESS]' + moduleRegex = '^bbunthd(:(?P\d+))?$' - def __init__(self): + def __init__(self, brightness): import neopixel self.w = 22 self.h = 16 @@ -342,20 +342,19 @@ class BlinkenbuntHDOutput(Output): LED_PIN = 13 LED_FREQ_HZ = 800000 LED_DMA = 5 - LED_BRIGHTNESS = 50 LED_INVERT = False LED_PWM = 1 self.strip = neopixel.Adafruit_NeoPixel( LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, - LED_BRIGHTNESS, LED_PWM + brightness, LED_PWM ) self.strip.begin() self._color_cls = neopixel.Color @classmethod def fromRegexMatch(cls, regexMatch): - return cls() + return cls(brightness=regexMatch.groupdict().get('brightness', 50)) def sendFrame(self, frame): for y in range(self.h):