mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add log when device is online and unavailable (#143648)
This commit is contained in:
parent
d657298791
commit
cc7929f8fb
@ -91,6 +91,7 @@ class SwitchbotDataUpdateCoordinator(ActiveBluetoothDataUpdateCoordinator[None])
|
|||||||
"""Handle the device going unavailable."""
|
"""Handle the device going unavailable."""
|
||||||
super()._async_handle_unavailable(service_info)
|
super()._async_handle_unavailable(service_info)
|
||||||
self._was_unavailable = True
|
self._was_unavailable = True
|
||||||
|
_LOGGER.info("Device %s is unavailable", self.device_name)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_handle_bluetooth_event(
|
def _async_handle_bluetooth_event(
|
||||||
@ -114,6 +115,7 @@ class SwitchbotDataUpdateCoordinator(ActiveBluetoothDataUpdateCoordinator[None])
|
|||||||
if not self.device.advertisement_changed(adv) and not self._was_unavailable:
|
if not self.device.advertisement_changed(adv) and not self._was_unavailable:
|
||||||
return
|
return
|
||||||
self._was_unavailable = False
|
self._was_unavailable = False
|
||||||
|
_LOGGER.info("Device %s is online", self.device_name)
|
||||||
self.device.update_from_advertisement(adv)
|
self.device.update_from_advertisement(adv)
|
||||||
super()._async_handle_bluetooth_event(service_info, change)
|
super()._async_handle_bluetooth_event(service_info, change)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ rules:
|
|||||||
docs-installation-parameters: done
|
docs-installation-parameters: done
|
||||||
entity-unavailable: done
|
entity-unavailable: done
|
||||||
integration-owner: done
|
integration-owner: done
|
||||||
log-when-unavailable: todo
|
log-when-unavailable: done
|
||||||
parallel-updates: done
|
parallel-updates: done
|
||||||
reauthentication-flow:
|
reauthentication-flow:
|
||||||
status: exempt
|
status: exempt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user