Add device availability to Plugwise (#66152)

This commit is contained in:
Franck Nijhof 2022-02-09 10:33:06 +01:00 committed by GitHub
parent 2f08372026
commit bc9ccf0e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,11 @@ class PlugwiseEntity(CoordinatorEntity[PlugwiseData]):
}
)
@property
def available(self) -> bool:
"""Return if entity is available."""
return super().available and self._dev_id in self.coordinator.data.devices
async def async_added_to_hass(self) -> None:
"""Subscribe to updates."""
self._handle_coordinator_update()