Plugwise: implement device availability for non-legacy devices (#80191)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Bouwe Westerdijk
2022-10-13 09:24:14 +02:00
committed by GitHub
parent ea6368775b
commit 937aa286b7

View File

@@ -65,7 +65,11 @@ class PlugwiseEntity(CoordinatorEntity[PlugwiseDataUpdateCoordinator]):
@property
def available(self) -> bool:
"""Return if entity is available."""
return super().available and self._dev_id in self.coordinator.data.devices
return (
self._dev_id in self.coordinator.data.devices
and ("available" not in self.device or self.device["available"])
and super().available
)
@property
def device(self) -> dict[str, Any]: