From 6d16e89d72731b0496c9cc016f0a4c46adca3f4a Mon Sep 17 00:00:00 2001 From: Andreas Lehmann Date: Sat, 23 Nov 2024 10:42:26 +0100 Subject: [PATCH] return DEFAULT_BRIGHTNESS if brighness is none --- custom_components/rpi_gpio_pwm/light.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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