Adjust light test helpers to use Kelvin, and cleanup unused helpers (#133048)

Cleanup light test helper methods
This commit is contained in:
epenet
2024-12-12 16:49:25 +01:00
committed by GitHub
parent 33c799b2d0
commit 2ce2765e67
6 changed files with 28 additions and 114 deletions

View File

@@ -205,7 +205,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, "test_light", "on,50,192")
color_modes = [light.ColorMode.COLOR_TEMP]
state = hass.states.get("light.test")
@@ -463,7 +465,7 @@ async def test_sending_mqtt_commands_and_optimistic(
assert state.state == STATE_ON
# Set color_temp
await common.async_turn_on(hass, "light.test", color_temp=70)
await common.async_turn_on(hass, "light.test", color_temp_kelvin=14285)
mqtt_mock.async_publish.assert_called_once_with(
"test_light_rgb/set", "on,,70,--,-", 2, False
)
@@ -594,7 +596,7 @@ async def test_sending_mqtt_commands_non_optimistic_brightness_template(
assert state.state == STATE_UNKNOWN
# Set color_temp
await common.async_turn_on(hass, "light.test", color_temp=70)
await common.async_turn_on(hass, "light.test", color_temp_kelvin=14285)
mqtt_mock.async_publish.assert_called_once_with(
"test_light_rgb/set", "on,,70,--,-", 0, False
)