From 7931d74938060be9f5cc7b6d335d7b03394939f2 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 3 Sep 2023 12:39:49 -0500 Subject: [PATCH] Make bond BPUP callback a HassJob (#99470) --- homeassistant/components/bond/entity.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/bond/entity.py b/homeassistant/components/bond/entity.py index 3b3ace989508..03a5f444579c 100644 --- a/homeassistant/components/bond/entity.py +++ b/homeassistant/components/bond/entity.py @@ -17,7 +17,7 @@ from homeassistant.const import ( ATTR_SW_VERSION, ATTR_VIA_DEVICE, ) -from homeassistant.core import CALLBACK_TYPE, callback +from homeassistant.core import CALLBACK_TYPE, HassJob, callback from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity from homeassistant.helpers.event import async_call_later @@ -68,6 +68,9 @@ class BondEntity(Entity): self._attr_assumed_state = self._hub.is_bridge and not self._device.trust_state self._apply_state() self._bpup_polling_fallback: CALLBACK_TYPE | None = None + self._async_update_if_bpup_not_alive_job = HassJob( + self._async_update_if_bpup_not_alive + ) @property def device_info(self) -> DeviceInfo: @@ -185,7 +188,7 @@ class BondEntity(Entity): self._bpup_polling_fallback = async_call_later( self.hass, _BPUP_ALIVE_SCAN_INTERVAL if alive else _FALLBACK_SCAN_INTERVAL, - self._async_update_if_bpup_not_alive, + self._async_update_if_bpup_not_alive_job, ) async def async_will_remove_from_hass(self) -> None: