Skip to content

Commit

Permalink
Populate HVACAction/HVACMode for TouchlineSL zones (#131075)
Browse files Browse the repository at this point in the history
  • Loading branch information
peroo authored Nov 22, 2024
1 parent 7fba788 commit 11ef2b6
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions homeassistant/components/touchline_sl/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from homeassistant.components.climate import (
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.const import ATTR_TEMPERATURE, UnitOfTemperature
Expand Down Expand Up @@ -41,6 +42,7 @@ class TouchlineSLZone(CoordinatorEntity[TouchlineSLModuleCoordinator], ClimateEn
"""Roth Touchline SL Zone."""

_attr_has_entity_name = True
_attr_hvac_action = HVACAction.IDLE
_attr_hvac_mode = HVACMode.HEAT
_attr_hvac_modes = [HVACMode.HEAT]
_attr_name = None
Expand Down Expand Up @@ -124,3 +126,16 @@ def set_attr(self) -> None:
elif self.zone.mode == "globalSchedule":
schedule = self.zone.schedule
self._attr_preset_mode = schedule.name

if self.zone.algorithm == "heating":
self._attr_hvac_action = (
HVACAction.HEATING if self.zone.relay_on else HVACAction.IDLE
)
self._attr_hvac_mode = HVACMode.HEAT
self._attr_hvac_modes = [HVACMode.HEAT]
elif self.zone.algorithm == "cooling":
self._attr_hvac_action = (
HVACAction.COOLING if self.zone.relay_on else HVACAction.IDLE
)
self._attr_hvac_mode = HVACMode.COOL
self._attr_hvac_modes = [HVACMode.COOL]

0 comments on commit 11ef2b6

Please sign in to comment.