mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Adjust light test helpers to use Kelvin, and cleanup unused helpers (#133048)
Cleanup light test helper methods
This commit is contained in:
@ -423,7 +423,9 @@ async def test_single_color_mode(
|
||||
state = hass.states.get("light.test")
|
||||
assert state.state == STATE_UNKNOWN
|
||||
|
||||
await common.async_turn_on(hass, "light.test", brightness=50, color_temp=192)
|
||||
await common.async_turn_on(
|
||||
hass, "light.test", brightness=50, color_temp_kelvin=5208
|
||||
)
|
||||
|
||||
async_fire_mqtt_message(
|
||||
hass,
|
||||
@ -458,7 +460,9 @@ async def test_turn_on_with_unknown_color_mode_optimistic(
|
||||
assert state.state == STATE_ON
|
||||
|
||||
# Turn on the light with brightness or color_temp attributes
|
||||
await common.async_turn_on(hass, "light.test", brightness=50, color_temp=192)
|
||||
await common.async_turn_on(
|
||||
hass, "light.test", brightness=50, color_temp_kelvin=5208
|
||||
)
|
||||
state = hass.states.get("light.test")
|
||||
assert state.attributes.get("color_mode") == light.ColorMode.COLOR_TEMP
|
||||
assert state.attributes.get("brightness") == 50
|
||||
@ -1083,7 +1087,7 @@ async def test_sending_mqtt_commands_and_optimistic(
|
||||
state = hass.states.get("light.test")
|
||||
assert state.state == STATE_ON
|
||||
|
||||
await common.async_turn_on(hass, "light.test", color_temp=90)
|
||||
await common.async_turn_on(hass, "light.test", color_temp_kelvin=11111)
|
||||
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set",
|
||||
@ -1244,7 +1248,7 @@ async def test_sending_mqtt_commands_and_optimistic2(
|
||||
assert state.state == STATE_ON
|
||||
|
||||
# Turn the light on with color temperature
|
||||
await common.async_turn_on(hass, "light.test", color_temp=90)
|
||||
await common.async_turn_on(hass, "light.test", color_temp_kelvin=11111)
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set",
|
||||
JsonValidator('{"state":"ON","color_temp":90}'),
|
||||
|
Reference in New Issue
Block a user