mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
Return 'None' for light attributes when off instead of removing them (#101946)
This commit is contained in:
@@ -114,7 +114,7 @@ async def test_switch_read_light_state_dimmer(hass: HomeAssistant, utcnow) -> No
|
||||
# Initial state is that the light is off
|
||||
state = await helper.poll_and_get_state()
|
||||
assert state.state == "off"
|
||||
assert ATTR_COLOR_MODE not in state.attributes
|
||||
assert state.attributes[ATTR_COLOR_MODE] is None
|
||||
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [ColorMode.BRIGHTNESS]
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == 0
|
||||
|
||||
@@ -177,7 +177,7 @@ async def test_switch_read_light_state_hs(hass: HomeAssistant, utcnow) -> None:
|
||||
# Initial state is that the light is off
|
||||
state = await helper.poll_and_get_state()
|
||||
assert state.state == "off"
|
||||
assert ATTR_COLOR_MODE not in state.attributes
|
||||
assert state.attributes[ATTR_COLOR_MODE] is None
|
||||
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [ColorMode.HS]
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == 0
|
||||
|
||||
@@ -246,7 +246,7 @@ async def test_switch_read_light_state_color_temp(hass: HomeAssistant, utcnow) -
|
||||
# Initial state is that the light is off
|
||||
state = await helper.poll_and_get_state()
|
||||
assert state.state == "off"
|
||||
assert ATTR_COLOR_MODE not in state.attributes
|
||||
assert state.attributes[ATTR_COLOR_MODE] is None
|
||||
assert state.attributes[ATTR_SUPPORTED_COLOR_MODES] == [ColorMode.COLOR_TEMP]
|
||||
assert state.attributes[ATTR_SUPPORTED_FEATURES] == 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user