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

pull/109071/head
Paul Bottein 2024-01-29 21:46:04 +01:00 committed by GitHub
parent 872a59f405
commit 02ac985120
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 16 deletions

View File

@ -56,10 +56,10 @@ async def async_setup_entry(
unit_of_measurement=UnitOfTemperature.CELSIUS,
preset=None,
current_temperature=22,
fan_mode="On High",
fan_mode="on_high",
target_humidity=67,
current_humidity=54,
swing_mode="Off",
swing_mode="off",
hvac_mode=HVACMode.COOL,
hvac_action=HVACAction.COOLING,
aux=False,
@ -75,10 +75,10 @@ async def async_setup_entry(
preset="home",
preset_modes=["home", "eco", "away"],
current_temperature=23,
fan_mode="Auto Low",
fan_mode="auto_low",
target_humidity=None,
current_humidity=None,
swing_mode="Auto",
swing_mode="auto",
hvac_mode=HVACMode.HEAT_COOL,
hvac_action=None,
aux=None,

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,

View File

@ -243,7 +243,7 @@ async def test_query_climate_request(
"thermostatTemperatureAmbient": 23,
"thermostatMode": "heatcool",
"thermostatTemperatureSetpointLow": 21,
"currentFanSpeedSetting": "Auto Low",
"currentFanSpeedSetting": "auto_low",
}
assert devices["climate.hvac"] == {
"online": True,
@ -251,7 +251,7 @@ async def test_query_climate_request(
"thermostatTemperatureAmbient": 22,
"thermostatMode": "cool",
"thermostatHumidityAmbient": 54,
"currentFanSpeedSetting": "On High",
"currentFanSpeedSetting": "on_high",
}
@ -304,7 +304,7 @@ async def test_query_climate_request_f(
"thermostatTemperatureAmbient": -5,
"thermostatMode": "heatcool",
"thermostatTemperatureSetpointLow": -6.1,
"currentFanSpeedSetting": "Auto Low",
"currentFanSpeedSetting": "auto_low",
}
assert devices["climate.hvac"] == {
"online": True,
@ -312,7 +312,7 @@ async def test_query_climate_request_f(
"thermostatTemperatureAmbient": -5.6,
"thermostatMode": "cool",
"thermostatHumidityAmbient": 54,
"currentFanSpeedSetting": "On High",
"currentFanSpeedSetting": "on_high",
}
hass_fixture.config.units.temperature_unit = UnitOfTemperature.CELSIUS