mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +00:00
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
This commit is contained in:
parent
1c0814d6f6
commit
f2617fd74a
@ -54,9 +54,12 @@ class HMLight(HMDevice, Light):
|
|||||||
@property
|
@property
|
||||||
def supported_features(self):
|
def supported_features(self):
|
||||||
"""Flag supported features."""
|
"""Flag supported features."""
|
||||||
|
features = SUPPORT_BRIGHTNESS
|
||||||
if "COLOR" in self._hmdevice.WRITENODE:
|
if "COLOR" in self._hmdevice.WRITENODE:
|
||||||
return SUPPORT_BRIGHTNESS | SUPPORT_COLOR | SUPPORT_EFFECT
|
features |= SUPPORT_COLOR
|
||||||
return SUPPORT_BRIGHTNESS
|
if "PROGRAM" in self._hmdevice.WRITENODE:
|
||||||
|
features |= SUPPORT_EFFECT
|
||||||
|
return features
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hs_color(self):
|
def hs_color(self):
|
||||||
@ -110,4 +113,6 @@ class HMLight(HMDevice, Light):
|
|||||||
self._data[self._state] = None
|
self._data[self._state] = None
|
||||||
|
|
||||||
if self.supported_features & SUPPORT_COLOR:
|
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})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user