airzone: update aioairzone to v0.5.2 (#84690)

This commit is contained in:
Álvaro Fernández Rojas 2022-12-28 16:37:50 +01:00 committed by GitHub
parent 29797b93f7
commit 5d4591a3ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 101 additions and 4 deletions

View file

@ -3,7 +3,7 @@
"name": "Airzone",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/airzone",
"requirements": ["aioairzone==0.5.1"],
"requirements": ["aioairzone==0.5.2"],
"codeowners": ["@Noltari"],
"iot_class": "local_polling",
"loggers": ["aioairzone"],

View file

@ -119,7 +119,7 @@ aio_georss_gdacs==0.7
aioairq==0.2.4
# homeassistant.components.airzone
aioairzone==0.5.1
aioairzone==0.5.2
# homeassistant.components.ambient_station
aioambient==2021.11.0

View file

@ -106,7 +106,7 @@ aio_georss_gdacs==0.7
aioairq==0.2.4
# homeassistant.components.airzone
aioairzone==0.5.1
aioairzone==0.5.2
# homeassistant.components.ambient_station
aioambient==2021.11.0

View file

@ -78,3 +78,9 @@ async def test_airzone_create_binary_sensors(hass: HomeAssistant) -> None:
state = hass.states.get("binary_sensor.salon_problem")
assert state.state == STATE_OFF
state = hass.states.get("binary_sensor.airzone_2_1_battery_low")
assert state is None
state = hass.states.get("binary_sensor.airzone_2_1_problem")
assert state.state == STATE_OFF

View file

@ -131,6 +131,20 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None:
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP
assert state.attributes.get(ATTR_TEMPERATURE) == 19.1
state = hass.states.get("climate.airzone_2_1")
assert state.state == HVACMode.OFF
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 62
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 22.3
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.HEAT_COOL,
HVACMode.OFF,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == API_TEMPERATURE_STEP
assert state.attributes.get(ATTR_TEMPERATURE) == 19.0
async def test_airzone_climate_turn_on_off(hass: HomeAssistant) -> None:
"""Test turning on."""
@ -187,6 +201,31 @@ async def test_airzone_climate_turn_on_off(hass: HomeAssistant) -> None:
state = hass.states.get("climate.salon")
assert state.state == HVACMode.OFF
HVAC_MOCK = {
API_DATA: [
{
API_SYSTEM_ID: 2,
API_ZONE_ID: 1,
API_ON: 1,
}
]
}
with patch(
"homeassistant.components.airzone.AirzoneLocalApi.put_hvac",
return_value=HVAC_MOCK,
):
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_TURN_ON,
{
ATTR_ENTITY_ID: "climate.airzone_2_1",
},
blocking=True,
)
state = hass.states.get("climate.airzone_2_1")
assert state.state == HVACMode.HEAT_COOL
async def test_airzone_climate_set_hvac_mode(hass: HomeAssistant) -> None:
"""Test setting the HVAC mode."""
@ -246,6 +285,32 @@ async def test_airzone_climate_set_hvac_mode(hass: HomeAssistant) -> None:
state = hass.states.get("climate.salon")
assert state.state == HVACMode.OFF
HVAC_MOCK_3 = {
API_DATA: [
{
API_SYSTEM_ID: 2,
API_ZONE_ID: 1,
API_ON: 1,
}
]
}
with patch(
"homeassistant.components.airzone.AirzoneLocalApi.put_hvac",
return_value=HVAC_MOCK_3,
):
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
{
ATTR_ENTITY_ID: "climate.airzone_2_1",
ATTR_HVAC_MODE: HVACMode.HEAT_COOL,
},
blocking=True,
)
state = hass.states.get("climate.airzone_2_1")
assert state.state == HVACMode.HEAT_COOL
async def test_airzone_climate_set_hvac_slave_error(hass: HomeAssistant) -> None:
"""Test setting the HVAC mode for a slave zone."""

View file

@ -48,3 +48,9 @@ async def test_airzone_create_sensors(
state = hass.states.get("sensor.salon_humidity")
assert state.state == "34"
state = hass.states.get("sensor.airzone_2_1_temperature")
assert state.state == "22.3"
state = hass.states.get("sensor.airzone_2_1_humidity")
assert state.state == "62"

View file

@ -177,7 +177,27 @@ HVAC_MOCK = {
API_FLOOR_DEMAND: 0,
},
]
}
},
{
API_DATA: [
{
API_SYSTEM_ID: 2,
API_ZONE_ID: 1,
API_ON: 0,
API_MAX_TEMP: 30,
API_MIN_TEMP: 15,
API_SET_POINT: 19,
API_ROOM_TEMP: 22.299999,
API_COLD_STAGES: 1,
API_COLD_STAGE: 1,
API_HEAT_STAGES: 1,
API_HEAT_STAGE: 1,
API_HUMIDITY: 62,
API_UNITS: 0,
API_ERRORS: [],
},
]
},
]
}