mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use light enums in zwave_js (#70791)
This commit is contained in:
parent
01dffc3447
commit
fe0120b65a
@ -31,9 +31,9 @@ from homeassistant.components.light import (
|
||||
ATTR_RGBW_COLOR,
|
||||
ATTR_TRANSITION,
|
||||
DOMAIN as LIGHT_DOMAIN,
|
||||
SUPPORT_TRANSITION,
|
||||
ColorMode,
|
||||
LightEntity,
|
||||
LightEntityFeature,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
@ -160,7 +160,7 @@ class ZwaveLight(ZWaveBaseEntity, LightEntity):
|
||||
)
|
||||
|
||||
if self.supports_brightness_transition or self.supports_color_transition:
|
||||
self._attr_supported_features |= SUPPORT_TRANSITION
|
||||
self._attr_supported_features |= LightEntityFeature.TRANSITION
|
||||
|
||||
@callback
|
||||
def on_value_update(self) -> None:
|
||||
|
@ -14,7 +14,7 @@ from homeassistant.components.light import (
|
||||
ATTR_SUPPORTED_COLOR_MODES,
|
||||
ATTR_TRANSITION,
|
||||
DOMAIN as LIGHT_DOMAIN,
|
||||
SUPPORT_TRANSITION,
|
||||
LightEntityFeature,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID,
|
||||
@ -44,7 +44,7 @@ async def test_light(hass, client, bulb_6_multi_color, integration):
|
||||
assert state.state == STATE_OFF
|
||||
assert state.attributes[ATTR_MIN_MIREDS] == 153
|
||||
assert state.attributes[ATTR_MAX_MIREDS] == 370
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == SUPPORT_TRANSITION
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == LightEntityFeature.TRANSITION
|
||||
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == ["color_temp", "hs"]
|
||||
|
||||
# Test turning on
|
||||
@ -478,7 +478,7 @@ async def test_rgbw_light(hass, client, zen_31, integration):
|
||||
|
||||
assert state
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == SUPPORT_TRANSITION
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == LightEntityFeature.TRANSITION
|
||||
|
||||
# Test turning on
|
||||
await hass.services.async_call(
|
||||
@ -543,7 +543,7 @@ async def test_light_none_color_value(hass, light_color_null_values, integration
|
||||
|
||||
assert state
|
||||
assert state.state == STATE_ON
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == SUPPORT_TRANSITION
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == LightEntityFeature.TRANSITION
|
||||
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == ["hs"]
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user