diff --git a/homeassistant/components/knx/light.py b/homeassistant/components/knx/light.py index efd1a74f5a2..8570c2eb09a 100644 --- a/homeassistant/components/knx/light.py +++ b/homeassistant/components/knx/light.py @@ -180,9 +180,13 @@ class KNXLight(Light): @property def brightness(self): """Return the brightness of this light between 0..255.""" - if not self.device.supports_brightness: - return None - return self.device.current_brightness + if self.device.supports_brightness: + return self.device.current_brightness + hsv_color = self._hsv_color + if self.device.supports_color and hsv_color: + # pylint: disable=unsubscriptable-object + return round(hsv_color[-1] / 100 * 255) + return None @property def hs_color(self): @@ -192,6 +196,14 @@ class KNXLight(Light): rgb, _ = self.device.current_color return color_util.color_RGB_to_hs(*rgb) if rgb else None + @property + def _hsv_color(self): + """Return the HSV color value.""" + rgb = None + if self.device.supports_rgbw or self.device.supports_color: + rgb, _ = self.device.current_color + return color_util.color_RGB_to_hsv(*rgb) if rgb else None + @property def white_value(self): """Return the white value."""