diff --git a/custom_components/wiser/climate.py b/custom_components/wiser/climate.py index 6783e87..9d551f7 100755 --- a/custom_components/wiser/climate.py +++ b/custom_components/wiser/climate.py @@ -20,6 +20,7 @@ from homeassistant.helpers import entity_platform from homeassistant.helpers.update_coordinator import CoordinatorEntity from aioWiserHeatAPI.wiserhub import TEMP_MINIMUM, TEMP_MAXIMUM, TEMP_OFF +from aioWiserHeatAPI.devices import _WiserRoomStat, _WiserSmartValve from .const import ( DATA, DOMAIN, @@ -525,6 +526,33 @@ def extra_state_attributes(self): if self._room.is_passive_mode: attrs["passive_mode_temp_increment"] = self.passive_temperature_increment + # Climate devices (iTRVs and Roomstats) + attrs["number_of_trvs"] = len( + [ + device + for device in self._room.devices + if isinstance(device, (_WiserSmartValve)) + ] + ) + attrs["number_of_trvs_locked"] = len( + [ + device + for device in self._room.devices + if isinstance(device, (_WiserSmartValve)) and device.device_lock_enabled + ] + ) + attrs["is_roomstat_locked"] = ( + len( + [ + device + for device in self._room.devices + if isinstance(device, (_WiserRoomStat)) + and device.device_lock_enabled + ] + ) + > 0 + ) + return attrs @property