diff --git a/custom_components/multimatic/climate.py b/custom_components/multimatic/climate.py index 7fc61a7..149b21c 100644 --- a/custom_components/multimatic/climate.py +++ b/custom_components/multimatic/climate.py @@ -80,7 +80,7 @@ async def async_setup_entry(hass, entry, async_add_entities): climates.append(ZoneClimate(zones_coo, zone, ventilation_coo.data)) if rooms_coo.data: - rbr_zone = [zone for zone in zones_coo.data if zone.rbr][0] + rbr_zone = next((zone for zone in zones_coo.data if zone.rbr), None) for room in rooms_coo.data: climates.append(RoomClimate(rooms_coo, zones_coo, room, rbr_zone)) @@ -240,7 +240,7 @@ def __init__( ) -> None: """Initialize entity.""" super().__init__(coordinator, room.name) - self._zone_id = zone.id + self._zone_id = zone.id if zone else None self._room_id = room.id self._supported_hvac = list(RoomClimate._HA_MODE_TO_MULTIMATIC.keys()) self._supported_presets = list(RoomClimate._HA_PRESET_TO_MULTIMATIC.keys()) @@ -287,7 +287,7 @@ def max_temp(self): @property def zone(self): """Return the zone the current room belongs.""" - if self._zone_coo.data: + if self._zone_coo.data and self._zone_id: return next( (zone for zone in self._zone_coo.data if zone.id == self._zone_id), None ) diff --git a/custom_components/multimatic/manifest.json b/custom_components/multimatic/manifest.json index e9de4e6..505162d 100644 --- a/custom_components/multimatic/manifest.json +++ b/custom_components/multimatic/manifest.json @@ -5,7 +5,7 @@ "documentation": "https://github.com/thomasgermain/vaillant-component", "issue_tracker": "https://github.com/thomasgermain/vaillant-component/issues", "requirements": [ - "pymultimatic==0.6.1" + "pymultimatic==0.6.2" ], "ssdp": [], "zeroconf": [], @@ -14,6 +14,6 @@ "codeowners": [ "@thomasgermain" ], - "version": "1.10.0", + "version": "1.10.1", "iot_class": "cloud_polling" }