1 """Support for the Airzone Cloud water heater."""
3 from __future__
import annotations
5 from typing
import Any, Final
7 from aioairzone_cloud.common
import HotWaterOperation, TemperatureUnit
8 from aioairzone_cloud.const
import (
28 WaterHeaterEntityFeature,
34 from .
import AirzoneCloudConfigEntry
35 from .coordinator
import AirzoneUpdateCoordinator
36 from .entity
import AirzoneHotWaterEntity
38 OPERATION_LIB_TO_HASS: Final[dict[HotWaterOperation, str]] = {
39 HotWaterOperation.Off: STATE_OFF,
40 HotWaterOperation.On: STATE_ECO,
41 HotWaterOperation.Powerful: STATE_PERFORMANCE,
44 OPERATION_MODE_TO_DHW_PARAMS: Final[dict[str, dict[str, Any]]] = {
71 entry: AirzoneCloudConfigEntry,
72 async_add_entities: AddEntitiesCallback,
74 """Add Airzone Cloud Water Heater from a config_entry."""
75 coordinator = entry.runtime_data
83 for dhw_id, dhw_data
in coordinator.data.get(AZD_HOT_WATERS, {}).items()
88 """Define an Airzone Cloud Water Heater."""
91 _attr_supported_features = (
92 WaterHeaterEntityFeature.TARGET_TEMPERATURE
93 | WaterHeaterEntityFeature.ON_OFF
94 | WaterHeaterEntityFeature.OPERATION_MODE
96 _attr_temperature_unit = UnitOfTemperature.CELSIUS
100 coordinator: AirzoneUpdateCoordinator,
104 """Initialize Airzone Cloud Water Heater."""
105 super().
__init__(coordinator, dhw_id, dhw_data)
109 OPERATION_LIB_TO_HASS[operation]
116 """Turn the water heater off."""
125 """Turn the water heater off."""
134 """Set new target operation mode."""
135 params = OPERATION_MODE_TO_DHW_PARAMS.get(operation_mode, {})
139 """Set new target temperature."""
140 params: dict[str, Any] = {}
141 if ATTR_TEMPERATURE
in kwargs:
142 params[API_SETPOINT] = {
143 API_VALUE: kwargs[ATTR_TEMPERATURE],
145 API_UNITS: TemperatureUnit.CELSIUS.value,
152 """Update attributes when the coordinator updates."""
158 """Update water heater attributes."""
None _async_update_params(self, dict[str, Any] params)
Any get_airzone_value(self, str key)
None _async_update_params(self, dict[str, Any] params)
Any get_airzone_value(self, str key)
None _async_update_attrs(self)
None __init__(self, AirzoneUpdateCoordinator coordinator, str dhw_id, dict dhw_data)
None async_set_temperature(self, **Any kwargs)
None async_set_operation_mode(self, str operation_mode)
None _handle_coordinator_update(self)
_attr_current_temperature
None async_turn_on(self, **Any kwargs)
None async_turn_off(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, AirzoneCloudConfigEntry entry, AddEntitiesCallback async_add_entities)