Migrate Bluetooth coordinators to use Debouncer async_schedule_call (#111077)

* Switch Bluetooth to use Debouncer async_schedule_call

If the debouncer does not fire the underlying call no task has to be
scheduled

* revert change in init

* revert change in init

* revert change in init
This commit is contained in:
J. Nick Koston 2024-02-21 21:03:22 -06:00 committed by GitHub
parent 5267e4f5db
commit e88dfd4f68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -168,7 +168,7 @@ class ActiveBluetoothDataUpdateCoordinator(
# We use bluetooth events to trigger the poll so that we scan as soon as
# possible after a device comes online or back in range, if a poll is due
if self.needs_poll(service_info):
self.hass.async_create_task(self._debounced_poll.async_call())
self._debounced_poll.async_schedule_call()
@callback
def _async_stop(self) -> None:

View File

@ -157,7 +157,7 @@ class ActiveBluetoothProcessorCoordinator(
# We use bluetooth events to trigger the poll so that we scan as soon as
# possible after a device comes online or back in range, if a poll is due
if self.needs_poll(service_info):
self.hass.async_create_task(self._debounced_poll.async_call())
self._debounced_poll.async_schedule_call()
@callback
def _async_stop(self) -> None: