TP Link: Don't report HS when in CT mode (#49704)
* TP Link: Don't report HS when in CT mode * Update tests
This commit is contained in:
parent
0d410209d2
commit
b00ccf98f0
2 changed files with 4 additions and 3 deletions
|
@ -354,7 +354,7 @@ class TPLinkSmartBulb(LightEntity):
|
|||
):
|
||||
color_temp = kelvin_to_mired(light_state_params[LIGHT_STATE_COLOR_TEMP])
|
||||
|
||||
if light_features.supported_features & SUPPORT_COLOR:
|
||||
if color_temp is None and light_features.supported_features & SUPPORT_COLOR:
|
||||
hue_saturation = (
|
||||
light_state_params[LIGHT_STATE_HUE],
|
||||
light_state_params[LIGHT_STATE_SATURATION],
|
||||
|
|
|
@ -524,8 +524,8 @@ async def test_light(hass: HomeAssistant, light_mock_data: LightMockData) -> Non
|
|||
state = hass.states.get("light.light1")
|
||||
assert state.state == "on"
|
||||
assert state.attributes["brightness"] == 51
|
||||
assert state.attributes["hs_color"] == (110, 90)
|
||||
assert state.attributes["color_temp"] == 222
|
||||
assert "hs_color" not in state.attributes
|
||||
assert light_state["on_off"] == 1
|
||||
|
||||
await hass.services.async_call(
|
||||
|
@ -541,6 +541,7 @@ async def test_light(hass: HomeAssistant, light_mock_data: LightMockData) -> Non
|
|||
assert state.state == "on"
|
||||
assert state.attributes["brightness"] == 56
|
||||
assert state.attributes["hs_color"] == (23, 27)
|
||||
assert "color_temp" not in state.attributes
|
||||
assert light_state["brightness"] == 22
|
||||
assert light_state["hue"] == 23
|
||||
assert light_state["saturation"] == 27
|
||||
|
@ -580,8 +581,8 @@ async def test_light(hass: HomeAssistant, light_mock_data: LightMockData) -> Non
|
|||
state = hass.states.get("light.light1")
|
||||
assert state.state == "on"
|
||||
assert state.attributes["brightness"] == 168
|
||||
assert state.attributes["hs_color"] == (77, 78)
|
||||
assert state.attributes["color_temp"] == 156
|
||||
assert "hs_color" not in state.attributes
|
||||
assert light_state["brightness"] == 66
|
||||
assert light_state["hue"] == 77
|
||||
assert light_state["saturation"] == 78
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue