1 """Support for stiebel_eltron climate platform."""
3 from __future__
import annotations
19 from .
import DOMAIN
as STE_DOMAIN
21 DEPENDENCIES = [
"stiebel_eltron"]
23 _LOGGER = logging.getLogger(__name__)
26 PRESET_SETBACK =
"setback"
27 PRESET_EMERGENCY =
"emergency"
29 SUPPORT_HVAC = [HVACMode.AUTO, HVACMode.HEAT, HVACMode.OFF]
30 SUPPORT_PRESET = [PRESET_ECO, PRESET_DAY, PRESET_EMERGENCY, PRESET_SETBACK]
34 "AUTOMATIC": HVACMode.AUTO,
35 "MANUAL MODE": HVACMode.HEAT,
36 "STANDBY": HVACMode.AUTO,
37 "DAY MODE": HVACMode.AUTO,
38 "SETBACK MODE": HVACMode.AUTO,
40 "EMERGENCY OPERATION": HVACMode.AUTO,
44 "STANDBY": PRESET_ECO,
45 "DAY MODE": PRESET_DAY,
46 "SETBACK MODE": PRESET_SETBACK,
47 "EMERGENCY OPERATION": PRESET_EMERGENCY,
51 HVACMode.AUTO:
"AUTOMATIC",
52 HVACMode.HEAT:
"MANUAL MODE",
56 HA_TO_STE_PRESET = {k: i
for i, k
in STE_TO_HA_PRESET.items()}
62 add_entities: AddEntitiesCallback,
63 discovery_info: DiscoveryInfoType |
None =
None,
65 """Set up the StiebelEltron platform."""
66 name = hass.data[STE_DOMAIN][
"name"]
67 ste_data = hass.data[STE_DOMAIN][
"ste_data"]
73 """Representation of a STIEBEL ELTRON heat pump."""
75 _attr_hvac_modes = SUPPORT_HVAC
76 _attr_supported_features = (
77 ClimateEntityFeature.TARGET_TEMPERATURE
78 | ClimateEntityFeature.PRESET_MODE
79 | ClimateEntityFeature.TURN_OFF
80 | ClimateEntityFeature.TURN_ON
82 _attr_temperature_unit = UnitOfTemperature.CELSIUS
83 _enable_turn_on_off_backwards_compatibility =
False
86 """Initialize the unit."""
97 """Update unit attributes."""
113 """Return device specific state attributes."""
118 """Return the name of the climate device."""
119 return self.
_name_name
125 """Return the current temperature."""
130 """Return the temperature we try to reach."""
135 """Return the supported step of target temperature."""
140 """Return the minimum temperature."""
145 """Return the maximum temperature."""
150 """Return the current humidity."""
151 return float(f
"{self._current_humidity:.1f}")
155 """Return current operation ie. heat, cool, idle."""
156 return STE_TO_HA_HVAC.get(self.
_operation_operation)
160 """Return the current preset mode, e.g., home, away, temp."""
161 return STE_TO_HA_PRESET.get(self.
_operation_operation)
165 """Return a list of available preset modes."""
166 return SUPPORT_PRESET
169 """Set new operation mode."""
172 new_mode = HA_TO_STE_HVAC.get(hvac_mode)
173 _LOGGER.debug(
"set_hvac_mode: %s -> %s", self.
_operation_operation, new_mode)
174 self.
_ste_data_ste_data.api.set_operation(new_mode)
178 """Set new target temperature."""
179 target_temperature = kwargs.get(ATTR_TEMPERATURE)
180 if target_temperature
is not None:
181 _LOGGER.debug(
"set_temperature: %s", target_temperature)
182 self.
_ste_data_ste_data.api.set_target_temp(target_temperature)
186 """Set new preset mode."""
187 new_mode = HA_TO_STE_PRESET.get(preset_mode)
188 _LOGGER.debug(
"set_hvac_mode: %s -> %s", self.
_operation_operation, new_mode)
189 self.
_ste_data_ste_data.api.set_operation(new_mode)
str|None preset_mode(self)
def target_temperature(self)
def current_temperature(self)
def extra_state_attributes(self)
def current_humidity(self)
None set_hvac_mode(self, HVACMode hvac_mode)
def __init__(self, name, ste_data)
None set_temperature(self, **Any kwargs)
None set_preset_mode(self, str preset_mode)
def target_temperature_step(self)
None add_entities(AsusWrtRouter router, AddEntitiesCallback async_add_entities, set[str] tracked)
None setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback add_entities, DiscoveryInfoType|None discovery_info=None)