diff --git a/custom_components/rpi_gpio_pwm/light.py b/custom_components/rpi_gpio_pwm/light.py index f363e48..0c6ea28 100644 --- a/custom_components/rpi_gpio_pwm/light.py +++ b/custom_components/rpi_gpio_pwm/light.py @@ -203,4 +203,4 @@ def turn_off(self, **kwargs): def _from_hass_brightness(brightness): """Convert Home Assistant brightness units to percentage.""" - return brightness / 255 + return brightness / 255 or DEFAULT_BRIGHTNESS