From f2617fd74a46ebcede264d8309437f177c1bfde5 Mon Sep 17 00:00:00 2001 From: guillempages Date: Sat, 19 Oct 2019 14:40:42 +0200 Subject: [PATCH] Split homematic color and effect support (#27299) * [homematic] Split color and effect support There are homematic devices (like HmIP-BSL) that support color but do not support effects. Split the support, so that color can be supported even if effects are not. * Make effect fully independent of color If a device supports effects for e.g. just brightness, it shouldn't be coupled to the color --- homeassistant/components/homematic/light.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homematic/light.py b/homeassistant/components/homematic/light.py index 971a8a9cac0..32fa0bb358e 100644 --- a/homeassistant/components/homematic/light.py +++ b/homeassistant/components/homematic/light.py @@ -54,9 +54,12 @@ class HMLight(HMDevice, Light): @property def supported_features(self): """Flag supported features.""" + features = SUPPORT_BRIGHTNESS if "COLOR" in self._hmdevice.WRITENODE: - return SUPPORT_BRIGHTNESS | SUPPORT_COLOR | SUPPORT_EFFECT - return SUPPORT_BRIGHTNESS + features |= SUPPORT_COLOR + if "PROGRAM" in self._hmdevice.WRITENODE: + features |= SUPPORT_EFFECT + return features @property def hs_color(self): @@ -110,4 +113,6 @@ class HMLight(HMDevice, Light): self._data[self._state] = None if self.supported_features & SUPPORT_COLOR: - self._data.update({"COLOR": None, "PROGRAM": None}) + self._data.update({"COLOR": None}) + if self.supported_features & SUPPORT_EFFECT: + self._data.update({"PROGRAM": None})