diff --git a/custom_components/peaqhvac/sensors/simple_sensor.py b/custom_components/peaqhvac/sensors/simple_sensor.py index c38fa5f8..e076dfe3 100644 --- a/custom_components/peaqhvac/sensors/simple_sensor.py +++ b/custom_components/peaqhvac/sensors/simple_sensor.py @@ -4,7 +4,6 @@ from custom_components.peaqhvac.const import HEATINGDEMAND, WATERDEMAND, NEXT_WATER_START, LATEST_WATER_BOOST from custom_components.peaqhvac.sensors.sensorbase import SensorBase -from custom_components.peaqhvac.service.hvac.water_heater.models.group import Group import logging _LOGGER = logging.getLogger(__name__) @@ -17,7 +16,6 @@ def __init__(self, hub, entry_id, name: str, internal_entity: str, icon: str = " super().__init__(hub, self._attr_name, entry_id) self._internal_entity = internal_entity self._state = "" - self._groups = None @property def state(self) -> str: @@ -32,35 +30,9 @@ async def async_update(self) -> None: if ret is not None: if self._internal_entity == NEXT_WATER_START: self._state = self._set_next_start(ret) - self._groups = self._create_groups_display(self._hub.hvac.water_heater.booster.model.groups) else: self._state = ret - @property - def extra_state_attributes(self) -> dict: - attr_dict = {} - if self._internal_entity == NEXT_WATER_START: - attr_dict["groups"] = self._groups - return attr_dict - - @staticmethod - def _create_groups_display(groups: list[Group]) -> dict: - def __set_group_hours(hours: list) -> list: - _ret = [] - for h in hours: - if h > 23: - _ret.append(f"{h-24:02d}:00⁺¹") - else: - _ret.append(f"{h:02d}:00") - return _ret - - ret = {} - for idx, g in enumerate(groups): - val = (g.group_type.value.capitalize(), __set_group_hours(g.hours)) - #_LOGGER.debug(f"Group {idx}: {val}") - ret[idx]= val - return ret - @staticmethod def _set_next_start(next_start: datetime) -> str: if next_start > datetime.now() + timedelta(days=2):