From c962a0024d778786376079ef9f307940b354763e Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Wed, 18 Oct 2023 16:33:58 +0200 Subject: [PATCH] Set device to unavailable if its not provided anymore --- custom_components/speedport/device_tracker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/speedport/device_tracker.py b/custom_components/speedport/device_tracker.py index 9e917f2..4ab3e32 100644 --- a/custom_components/speedport/device_tracker.py +++ b/custom_components/speedport/device_tracker.py @@ -115,3 +115,7 @@ def _handle_coordinator_update(self) -> None: """Handle updated data from the coordinator.""" self._device = self.coordinator.data.get(self._mac) self.async_write_ha_state() + + @property + def available(self) -> bool: + return super().available and self._device is not None