From f6836085428d298611b2a13bc60b869b9d2566a6 Mon Sep 17 00:00:00 2001 From: Tom Mount Date: Wed, 4 Oct 2023 10:31:18 -0400 Subject: [PATCH] drivers/led/neopixel: Fix lint issue. Signed-off-by: Tom Mount --- micropython/drivers/led/neopixel/neopixel.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/micropython/drivers/led/neopixel/neopixel.py b/micropython/drivers/led/neopixel/neopixel.py index b71833ca9..b9a0fddfd 100644 --- a/micropython/drivers/led/neopixel/neopixel.py +++ b/micropython/drivers/led/neopixel/neopixel.py @@ -8,12 +8,12 @@ class NeoPixel: # G R B W ORDER = (1, 0, 2, 3) - def __init__(self, pin, n, bpp=3, timing=1, brightness: float = None): + def __init__(self, pin, n, bpp=3, timing=1, brightness=None): self.pin = pin self.n = n self.bpp = bpp self.brightness = ( - min(max(brightness, 0.0), 1.0) if brightness is not None else None + min(max(float(brightness), 0.0), 1.0) if brightness is not None else None ) self.buf = bytearray(n * bpp) self.pin.init(pin.OUT)