mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
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:
parent
575db4665d
commit
cc290b15f6
@ -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."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user