Skip to content

Commit 0889560

Browse files
committed
#255 Remove aux heat
* Remove aux heat in climate entity * Fix typo * Code cleanup
1 parent 4414bdd commit 0889560

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

custom_components/luxtronik/climate.py

+29-30
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@
103103
hvac_mode_mapping=HVAC_MODE_MAPPING_HEAT,
104104
hvac_action_mapping=HVAC_ACTION_MAPPING_HEAT,
105105
preset_modes=[PRESET_NONE, PRESET_AWAY, PRESET_BOOST],
106-
supported_features=ClimateEntityFeature.AUX_HEAT
107-
| ClimateEntityFeature.PRESET_MODE # noqa: W503
106+
supported_features=ClimateEntityFeature.PRESET_MODE
108107
| ClimateEntityFeature.TARGET_TEMPERATURE, # noqa: W503
109108
luxtronik_key=LuxParameter.P0003_MODE_HEATING,
110109
# luxtronik_key_current_temperature=LuxCalculation.C0227_ROOM_THERMOSTAT_TEMPERATURE,
@@ -172,7 +171,7 @@ class LuxtronikClimateExtraStoredData(ExtraStoredData):
172171
_attr_target_temperature: float | None = None
173172
_attr_hvac_mode: HVACMode | str | None = None
174173
_attr_preset_mode: str | None = None
175-
_attr_is_aux_heat: bool | None = None
174+
# _attr_is_aux_heat: bool | None = None
176175
last_hvac_mode_before_preset: str | None = None
177176

178177
def as_dict(self) -> dict[str, Any]:
@@ -194,7 +193,7 @@ class LuxtronikThermostat(LuxtronikEntity, ClimateEntity, RestoreEntity):
194193
_attr_target_temperature_low = 18.0
195194
_attr_target_temperature_step = 0.5
196195

197-
_attr_is_aux_heat: bool | None = None
196+
# _attr_is_aux_heat: bool | None = None
198197
_attr_hvac_mode: HVACMode | str | None = None
199198
_attr_preset_mode: str | None = None
200199

@@ -254,10 +253,10 @@ def _handle_coordinator_update(
254253
if lux_action is None
255254
else self.entity_description.hvac_action_mapping[lux_action]
256255
)
257-
self._attr_is_aux_heat = (
258-
None if mode is None else mode == LuxMode.second_heatsource.value
259-
)
260-
if self._attr_preset_mode == PRESET_NONE or self._attr_is_aux_heat:
256+
# self._attr_is_aux_heat = (
257+
# None if mode is None else mode == LuxMode.second_heatsource.value
258+
# )
259+
if self._attr_preset_mode == PRESET_NONE: # or self._attr_is_aux_heat:
261260
self._last_hvac_mode_before_preset = None
262261
key = self.entity_description.luxtronik_key_current_temperature
263262
if isinstance(key, str):
@@ -339,27 +338,27 @@ async def async_set_preset_mode(self, preset_mode: str) -> None:
339338
lux_mode = LuxMode.off.value
340339
await self._async_set_lux_mode(lux_mode)
341340

342-
async def async_turn_aux_heat_on(self) -> None:
343-
"""Turn auxiliary heater on."""
344-
self._attr_is_aux_heat = True
345-
if self._last_hvac_mode_before_preset is None:
346-
self._last_hvac_mode_before_preset = self._attr_hvac_mode
347-
await self._async_set_lux_mode(LuxMode.second_heatsource.value)
348-
349-
async def async_turn_aux_heat_off(self) -> None:
350-
"""Turn auxiliary heater off."""
351-
self._attr_is_aux_heat = False
352-
if (self._last_hvac_mode_before_preset is None) or (
353-
not self._last_hvac_mode_before_preset in HVAC_PRESET_MAPPING
354-
):
355-
await self._async_set_lux_mode(LuxMode.automatic.value)
356-
else:
357-
lux_mode = [
358-
k
359-
for k, v in HVAC_PRESET_MAPPING.items()
360-
if v == self._last_hvac_mode_before_preset
361-
][0]
362-
await self._async_set_lux_mode(lux_mode)
341+
# async def async_turn_aux_heat_on(self) -> None:
342+
# """Turn auxiliary heater on."""
343+
# self._attr_is_aux_heat = True
344+
# if self._last_hvac_mode_before_preset is None:
345+
# self._last_hvac_mode_before_preset = self._attr_hvac_mode
346+
# await self._async_set_lux_mode(LuxMode.second_heatsource.value)
347+
348+
# async def async_turn_aux_heat_off(self) -> None:
349+
# """Turn auxiliary heater off."""
350+
# self._attr_is_aux_heat = False
351+
# if (self._last_hvac_mode_before_preset is None) or (
352+
# not self._last_hvac_mode_before_preset in HVAC_PRESET_MAPPING
353+
# ):
354+
# await self._async_set_lux_mode(LuxMode.automatic.value)
355+
# else:
356+
# lux_mode = [
357+
# k
358+
# for k, v in HVAC_PRESET_MAPPING.items()
359+
# if v == self._last_hvac_mode_before_preset
360+
# ][0]
361+
# await self._async_set_lux_mode(lux_mode)
363362

364363
@property
365364
def extra_restore_state_data(self) -> LuxtronikClimateExtraStoredData:
@@ -368,6 +367,6 @@ def extra_restore_state_data(self) -> LuxtronikClimateExtraStoredData:
368367
self._attr_target_temperature,
369368
self._attr_hvac_mode,
370369
self._attr_preset_mode,
371-
self._attr_is_aux_heat,
370+
# self._attr_is_aux_heat,
372371
self._last_hvac_mode_before_preset,
373372
)

custom_components/luxtronik/const.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class LuxStatus3Option(StrEnum):
172172
thermal_desinfection: Final = ("thermal desinfection",)
173173
cooling: Final = ("cooling",)
174174
swimming_pool_solar: Final = ("swimming pool/solar",)
175-
heating_external_energy_source: Final = ("heating external engery source",)
175+
heating_external_energy_source: Final = ("heating external energy source",)
176176
domestic_water_external_energy_source: Final = (
177177
"domestic water external energy source",
178178
)

custom_components/luxtronik/lux_helper.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import struct
77
import threading
88
import time
9-
import asyncio
109

1110
from async_timeout import timeout
1211

0 commit comments

Comments
 (0)