Small cleanups to the inkbird coordinator (#142911)

This commit is contained in:
J. Nick Koston 2025-04-13 23:27:46 -10:00 committed by GitHub
parent a6643d8fb3
commit 621326f4e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,11 +50,6 @@ class INKBIRDActiveBluetoothProcessorCoordinator(
self._device_data = device_data self._device_data = device_data
address = entry.unique_id address = entry.unique_id
assert address is not None assert address is not None
entry.async_on_unload(
async_track_time_interval(
hass, self._async_schedule_poll, FALLBACK_POLL_INTERVAL
)
)
super().__init__( super().__init__(
hass=hass, hass=hass,
logger=_LOGGER, logger=_LOGGER,
@ -74,6 +69,11 @@ class INKBIRDActiveBluetoothProcessorCoordinator(
self._async_device_data_changed, self._async_device_data_changed,
) )
if not self._data.uses_notify: if not self._data.uses_notify:
self._entry.async_on_unload(
async_track_time_interval(
self.hass, self._async_schedule_poll, FALLBACK_POLL_INTERVAL
)
)
return return
if not (service_info := async_last_service_info(self.hass, self.address)): if not (service_info := async_last_service_info(self.hass, self.address)):
raise ConfigEntryNotReady( raise ConfigEntryNotReady(