mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Add device availability to Plugwise (#66152)
This commit is contained in:
parent
2f08372026
commit
bc9ccf0e47
@ -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:
|
async def async_added_to_hass(self) -> None:
|
||||||
"""Subscribe to updates."""
|
"""Subscribe to updates."""
|
||||||
self._handle_coordinator_update()
|
self._handle_coordinator_update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user