Fix available status of entities in Overkiz (#143538)

* Add availability property to OverkizEntity for device status

* Update homeassistant/components/overkiz/entity.py

Co-authored-by: J. Nick Koston <nick+github@koston.org>

---------

Co-authored-by: J. Nick Koston <nick+github@koston.org>
This commit is contained in:
Mick Vleeshouwer 2025-04-24 21:58:36 +02:00 committed by GitHub
parent 575db4665d
commit cc290b15f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -35,7 +35,6 @@ class OverkizEntity(CoordinatorEntity[OverkizDataUpdateCoordinator]):
self.executor = OverkizExecutor(device_url, coordinator) self.executor = OverkizExecutor(device_url, coordinator)
self._attr_assumed_state = not self.device.states self._attr_assumed_state = not self.device.states
self._attr_available = self.device.available
self._attr_unique_id = self.device.device_url self._attr_unique_id = self.device.device_url
if self.is_sub_device: if self.is_sub_device:
@ -44,6 +43,11 @@ class OverkizEntity(CoordinatorEntity[OverkizDataUpdateCoordinator]):
self._attr_device_info = self.generate_device_info() self._attr_device_info = self.generate_device_info()
@property
def available(self) -> bool:
"""Return True if entity is available."""
return self.device.available and super().available
@property @property
def is_sub_device(self) -> bool: def is_sub_device(self) -> bool:
"""Return True if device is a sub device.""" """Return True if device is a sub device."""