1 """Support for Alpha2 room control unit via Alpha2 base."""
18 from .const
import DOMAIN, PRESET_AUTO, PRESET_DAY, PRESET_NIGHT
19 from .coordinator
import Alpha2BaseCoordinator
21 _LOGGER = logging.getLogger(__name__)
26 config_entry: ConfigEntry,
27 async_add_entities: AddEntitiesCallback,
29 """Add Alpha2Climate entities from a config_entry."""
31 coordinator: Alpha2BaseCoordinator = hass.data[DOMAIN][config_entry.entry_id]
35 for heat_area_id
in coordinator.data[
"heat_areas"]
40 """Alpha2 ClimateEntity."""
42 target_temperature_step = 0.2
44 _attr_supported_features = (
45 ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
47 _attr_hvac_modes = [HVACMode.HEAT, HVACMode.COOL]
48 _attr_temperature_unit = UnitOfTemperature.CELSIUS
49 _attr_preset_modes = [PRESET_AUTO, PRESET_DAY, PRESET_NIGHT]
50 _enable_turn_on_off_backwards_compatibility =
False
52 def __init__(self, coordinator: Alpha2BaseCoordinator, heat_area_id: str) ->
None:
53 """Initialize Alpha2 ClimateEntity."""
61 """Return the heat area."""
62 return self.coordinator.data[
"heat_areas"][self.
heat_area_idheat_area_id]
66 """Return the minimum temperature."""
71 """Return the maximum temperature."""
76 """Return the current temperature."""
81 """Return current hvac mode."""
87 """Set new target hvac mode."""
92 """Return the current running hvac operation."""
93 if not self.
heat_areaheat_area[
"_HEATCTRL_STATE"]:
94 return HVACAction.IDLE
96 return HVACAction.COOLING
97 return HVACAction.HEATING
101 """Return the temperature we try to reach."""
105 """Set new target temperatures."""
106 if (target_temperature := kwargs.get(ATTR_TEMPERATURE))
is None:
115 """Return the current preset mode."""
116 if self.
heat_areaheat_area[
"HEATAREA_MODE"] == 1:
118 if self.
heat_areaheat_area[
"HEATAREA_MODE"] == 2:
123 """Set new operation mode."""
125 if preset_mode == PRESET_DAY:
127 elif preset_mode == PRESET_NIGHT:
dict[str, Any] heat_area(self)
None __init__(self, Alpha2BaseCoordinator coordinator, str heat_area_id)
None async_set_temperature(self, **Any kwargs)
HVACAction hvac_action(self)
None async_set_hvac_mode(self, HVACMode hvac_mode)
float target_temperature(self)
float current_temperature(self)
None async_set_preset_mode(self, str preset_mode)
None async_set_cooling(self, bool enabled)
None async_set_target_temperature(self, str heat_area_id, float target_temperature)
None async_set_heat_area_mode(self, str heat_area_id, int heat_area_mode)
web.Response get(self, web.Request request, str config_key)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)