mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Bugfix Zwave Light: Use only supported features for devices (#5370)
* Use only supported features for devices * Changes * Holy Macarony!
This commit is contained in:
parent
8496975de8
commit
c41cf7c308
@ -42,7 +42,10 @@ TEMP_MID_HASS = (HASS_COLOR_MAX - HASS_COLOR_MIN) / 2 + HASS_COLOR_MIN
|
||||
TEMP_WARM_HASS = (HASS_COLOR_MAX - HASS_COLOR_MIN) / 3 * 2 + HASS_COLOR_MIN
|
||||
TEMP_COLD_HASS = (HASS_COLOR_MAX - HASS_COLOR_MIN) / 3 + HASS_COLOR_MIN
|
||||
|
||||
SUPPORT_ZWAVE = SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP | SUPPORT_RGB_COLOR
|
||||
SUPPORT_ZWAVE_DIMMER = SUPPORT_BRIGHTNESS
|
||||
SUPPORT_ZWAVE_COLOR = SUPPORT_BRIGHTNESS | SUPPORT_RGB_COLOR
|
||||
SUPPORT_ZWAVE_COLORTEMP = (SUPPORT_BRIGHTNESS | SUPPORT_RGB_COLOR
|
||||
| SUPPORT_COLOR_TEMP)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
@ -161,7 +164,7 @@ class ZwaveDimmer(zwave.ZWaveDeviceEntity, Light):
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_ZWAVE
|
||||
return SUPPORT_ZWAVE_DIMMER
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Turn the device on."""
|
||||
@ -351,3 +354,11 @@ class ZwaveColorLight(ZwaveDimmer):
|
||||
self._value_color.node.set_rgbw(self._value_color.value_id, rgbw)
|
||||
|
||||
super().turn_on(**kwargs)
|
||||
|
||||
@property
|
||||
def supported_features(self):
|
||||
"""Flag supported features."""
|
||||
if self._zw098:
|
||||
return SUPPORT_ZWAVE_COLORTEMP
|
||||
else:
|
||||
return SUPPORT_ZWAVE_COLOR
|
||||
|
Loading…
x
Reference in New Issue
Block a user