1 """Support for the Airzone water heater."""
3 from __future__
import annotations
5 from typing
import Any, Final
7 from aioairzone.common
import HotWaterOperation
8 from aioairzone.const
import (
26 WaterHeaterEntityFeature,
33 from .
import AirzoneConfigEntry
34 from .const
import TEMP_UNIT_LIB_TO_HASS
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]]] = {
50 API_ACS_POWER_MODE: 0,
54 API_ACS_POWER_MODE: 1,
61 entry: AirzoneConfigEntry,
62 async_add_entities: AddEntitiesCallback,
64 """Add Airzone Water Heater from a config_entry."""
65 coordinator = entry.runtime_data
66 if AZD_HOT_WATER
in coordinator.data:
71 """Define an Airzone Water Heater."""
74 _attr_supported_features = (
75 WaterHeaterEntityFeature.TARGET_TEMPERATURE
76 | WaterHeaterEntityFeature.ON_OFF
77 | WaterHeaterEntityFeature.OPERATION_MODE
82 coordinator: AirzoneUpdateCoordinator,
85 """Initialize Airzone water heater entity."""
90 OPERATION_LIB_TO_HASS[operation]
100 """Turn the water heater off."""
104 """Turn the water heater off."""
108 """Set new target operation mode."""
109 params = OPERATION_MODE_TO_DHW_PARAMS.get(operation_mode, {})
113 """Set new target temperature."""
114 params: dict[str, Any] = {}
115 if ATTR_TEMPERATURE
in kwargs:
116 params[API_ACS_SET_POINT] = kwargs[ATTR_TEMPERATURE]
121 """Update attributes when the coordinator updates."""
127 """Update water heater attributes."""
Any get_airzone_value(self, str key)
Any get_airzone_value(self, str key)
None _async_update_dhw_params(self, dict[str, Any] params)
None async_set_operation_mode(self, str operation_mode)
None __init__(self, AirzoneUpdateCoordinator coordinator, ConfigEntry entry)
None async_turn_on(self, **Any kwargs)
None _async_update_attrs(self)
_attr_current_temperature
None async_turn_off(self, **Any kwargs)
None _handle_coordinator_update(self)
None async_set_temperature(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, AirzoneConfigEntry entry, AddEntitiesCallback async_add_entities)