1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Use right initial attribute value for demo climate (#108719)

This commit is contained in:
Paul Bottein
2024-01-29 21:46:04 +01:00
committed by GitHub
parent 872a59f405
commit 02ac985120
3 changed files with 16 additions and 16 deletions

View File

@@ -76,10 +76,10 @@ def test_setup_params(hass: HomeAssistant) -> None:
assert state.state == HVACMode.COOL
assert state.attributes.get(ATTR_TEMPERATURE) == 21
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 22
assert state.attributes.get(ATTR_FAN_MODE) == "On High"
assert state.attributes.get(ATTR_FAN_MODE) == "on_high"
assert state.attributes.get(ATTR_HUMIDITY) == 67
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 54
assert state.attributes.get(ATTR_SWING_MODE) == "Off"
assert state.attributes.get(ATTR_SWING_MODE) == "off"
assert state.attributes.get(ATTR_AUX_HEAT) == STATE_OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
@@ -256,7 +256,7 @@ async def test_set_target_humidity(hass: HomeAssistant) -> None:
async def test_set_fan_mode_bad_attr(hass: HomeAssistant) -> None:
"""Test setting fan mode without required attribute."""
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_FAN_MODE) == "On High"
assert state.attributes.get(ATTR_FAN_MODE) == "on_high"
with pytest.raises(vol.Invalid):
await hass.services.async_call(
@@ -267,13 +267,13 @@ async def test_set_fan_mode_bad_attr(hass: HomeAssistant) -> None:
)
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_FAN_MODE) == "On High"
assert state.attributes.get(ATTR_FAN_MODE) == "on_high"
async def test_set_fan_mode(hass: HomeAssistant) -> None:
"""Test setting of new fan mode."""
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_FAN_MODE) == "On High"
assert state.attributes.get(ATTR_FAN_MODE) == "on_high"
await hass.services.async_call(
DOMAIN,
@@ -289,7 +289,7 @@ async def test_set_fan_mode(hass: HomeAssistant) -> None:
async def test_set_swing_mode_bad_attr(hass: HomeAssistant) -> None:
"""Test setting swing mode without required attribute."""
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_SWING_MODE) == "Off"
assert state.attributes.get(ATTR_SWING_MODE) == "off"
with pytest.raises(vol.Invalid):
await hass.services.async_call(
@@ -300,13 +300,13 @@ async def test_set_swing_mode_bad_attr(hass: HomeAssistant) -> None:
)
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_SWING_MODE) == "Off"
assert state.attributes.get(ATTR_SWING_MODE) == "off"
async def test_set_swing(hass: HomeAssistant) -> None:
"""Test setting of new swing mode."""
state = hass.states.get(ENTITY_CLIMATE)
assert state.attributes.get(ATTR_SWING_MODE) == "Off"
assert state.attributes.get(ATTR_SWING_MODE) == "off"
await hass.services.async_call(
DOMAIN,