Skip to content

Commit

Permalink
Update aioairzone to v0.9.4 (#127792)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noltari authored and frenck committed Oct 18, 2024
1 parent f9cbf1b commit 7d2536c
Show file tree
Hide file tree
Showing 7 changed files with 152 additions and 6 deletions.
4 changes: 3 additions & 1 deletion homeassistant/components/airzone/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
OperationMode.HEATING: HVACMode.HEAT,
OperationMode.FAN: HVACMode.FAN_ONLY,
OperationMode.DRY: HVACMode.DRY,
OperationMode.AUX_HEATING: HVACMode.HEAT,
OperationMode.AUTO: HVACMode.HEAT_COOL,
}
HVAC_MODE_HASS_TO_LIB: Final[dict[HVACMode, OperationMode]] = {
Expand Down Expand Up @@ -157,9 +158,10 @@ def __init__(
self._attr_temperature_unit = TEMP_UNIT_LIB_TO_HASS[
self.get_airzone_value(AZD_TEMP_UNIT)
]
self._attr_hvac_modes = [
_attr_hvac_modes = [
HVAC_MODE_LIB_TO_HASS[mode] for mode in self.get_airzone_value(AZD_MODES)
]
self._attr_hvac_modes = list(dict.fromkeys(_attr_hvac_modes))
if (
self.get_airzone_value(AZD_SPEED) is not None
and self.get_airzone_value(AZD_SPEEDS) is not None
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/airzone/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone",
"iot_class": "local_polling",
"loggers": ["aioairzone"],
"requirements": ["aioairzone==0.9.3"]
"requirements": ["aioairzone==0.9.4"]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ aioairq==0.3.2
aioairzone-cloud==0.6.6

# homeassistant.components.airzone
aioairzone==0.9.3
aioairzone==0.9.4

# homeassistant.components.ambient_network
# homeassistant.components.ambient_station
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ aioairq==0.3.2
aioairzone-cloud==0.6.6

# homeassistant.components.airzone
aioairzone==0.9.3
aioairzone==0.9.4

# homeassistant.components.ambient_network
# homeassistant.components.ambient_station
Expand Down
100 changes: 98 additions & 2 deletions tests/components/airzone/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,45 @@
}),
]),
}),
dict({
'data': list([
dict({
'air_demand': 0,
'coldStage': 0,
'coldStages': 0,
'coolmaxtemp': 30,
'coolmintemp': 15,
'coolsetpoint': 20,
'errors': list([
]),
'floor_demand': 0,
'heatStage': 0,
'heatStages': 0,
'heatmaxtemp': 30,
'heatmintemp': 15,
'heatsetpoint': 20,
'humidity': 0,
'maxTemp': 30,
'minTemp': 15,
'mode': 6,
'modes': list([
1,
2,
3,
4,
5,
6,
]),
'name': 'Aux Heat',
'on': 1,
'roomTemp': 22,
'setpoint': 20,
'systemID': 4,
'units': 0,
'zoneID': 1,
}),
]),
}),
]),
}),
'version': dict({
Expand Down Expand Up @@ -269,8 +308,8 @@
'temp-set': 45,
'temp-unit': 0,
}),
'num-systems': 3,
'num-zones': 7,
'num-systems': 4,
'num-zones': 8,
'systems': dict({
'1': dict({
'available': True,
Expand Down Expand Up @@ -320,6 +359,23 @@
]),
'problems': False,
}),
'4': dict({
'available': True,
'full-name': 'Airzone [4] System',
'id': 4,
'master-system-zone': '4:1',
'master-zone': 1,
'mode': 6,
'modes': list([
1,
2,
3,
4,
5,
6,
]),
'problems': False,
}),
}),
'version': '1.62',
'webserver': dict({
Expand Down Expand Up @@ -683,6 +739,46 @@
'temp-step': 1.0,
'temp-unit': 1,
}),
'4:1': dict({
'absolute-temp-max': 30.0,
'absolute-temp-min': 15.0,
'action': 5,
'air-demand': False,
'available': True,
'cold-stage': 0,
'cool-temp-max': 30.0,
'cool-temp-min': 15.0,
'cool-temp-set': 20.0,
'demand': False,
'double-set-point': False,
'floor-demand': False,
'full-name': 'Airzone [4:1] Aux Heat',
'heat-stage': 0,
'heat-temp-max': 30.0,
'heat-temp-min': 15.0,
'heat-temp-set': 20.0,
'id': 1,
'master': True,
'mode': 6,
'modes': list([
1,
2,
3,
4,
5,
6,
]),
'name': 'Aux Heat',
'on': True,
'problems': False,
'system': 4,
'temp': 22.0,
'temp-max': 30.0,
'temp-min': 15.0,
'temp-set': 20.0,
'temp-step': 0.5,
'temp-unit': 0,
}),
}),
}),
})
Expand Down
17 changes: 17 additions & 0 deletions tests/components/airzone/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,23 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None:
assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0
assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 22.8

state = hass.states.get("climate.aux_heat")
assert state.state == HVACMode.HEAT
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) is None
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 22
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.IDLE
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
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) == 20.0

HVAC_MOCK_CHANGED = copy.deepcopy(HVAC_MOCK)
HVAC_MOCK_CHANGED[API_SYSTEMS][0][API_DATA][0][API_MAX_TEMP] = 25
HVAC_MOCK_CHANGED[API_SYSTEMS][0][API_DATA][0][API_MIN_TEMP] = 10
Expand Down
31 changes: 31 additions & 0 deletions tests/components/airzone/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,37 @@
},
]
},
{
API_DATA: [
{
API_SYSTEM_ID: 4,
API_ZONE_ID: 1,
API_NAME: "Aux Heat",
API_ON: 1,
API_COOL_SET_POINT: 20,
API_COOL_MAX_TEMP: 30,
API_COOL_MIN_TEMP: 15,
API_HEAT_SET_POINT: 20,
API_HEAT_MAX_TEMP: 30,
API_HEAT_MIN_TEMP: 15,
API_MAX_TEMP: 30,
API_MIN_TEMP: 15,
API_SET_POINT: 20,
API_ROOM_TEMP: 22,
API_MODES: [1, 2, 3, 4, 5, 6],
API_MODE: 6,
API_COLD_STAGES: 0,
API_COLD_STAGE: 0,
API_HEAT_STAGES: 0,
API_HEAT_STAGE: 0,
API_HUMIDITY: 0,
API_UNITS: 0,
API_ERRORS: [],
API_AIR_DEMAND: 0,
API_FLOOR_DEMAND: 0,
},
]
},
]
}

Expand Down

0 comments on commit 7d2536c

Please sign in to comment.