mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +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."""
|
||||
super()._async_handle_unavailable(service_info)
|
||||
self._was_unavailable = True
|
||||
_LOGGER.info("Device %s is unavailable", self.device_name)
|
||||
|
||||
@callback
|
||||
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:
|
||||
return
|
||||
self._was_unavailable = False
|
||||
_LOGGER.info("Device %s is online", self.device_name)
|
||||
self.device.update_from_advertisement(adv)
|
||||
super()._async_handle_bluetooth_event(service_info, change)
|
||||
|
||||
|
@ -32,7 +32,7 @@ rules:
|
||||
docs-installation-parameters: done
|
||||
entity-unavailable: done
|
||||
integration-owner: done
|
||||
log-when-unavailable: todo
|
||||
log-when-unavailable: done
|
||||
parallel-updates: done
|
||||
reauthentication-flow:
|
||||
status: exempt
|
||||
|
Loading…
x
Reference in New Issue
Block a user