From 937aa286b7ec8ae5a8112b96e0b847cf2218c19d Mon Sep 17 00:00:00 2001 From: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com> Date: Thu, 13 Oct 2022 09:24:14 +0200 Subject: [PATCH] Plugwise: implement device availability for non-legacy devices (#80191) Co-authored-by: Franck Nijhof --- homeassistant/components/plugwise/entity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/plugwise/entity.py b/homeassistant/components/plugwise/entity.py index 694f6e5817c..4d5f78f5202 100644 --- a/homeassistant/components/plugwise/entity.py +++ b/homeassistant/components/plugwise/entity.py @@ -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]: