Fix homekit_controller delaying startup and shutdown (#112671)
The alive poll was scheduled as a tracked task but should have been a background task so it was cancelled.
This commit is contained in:
parent
a6b17dbe68
commit
c101eb5001
1 changed files with 7 additions and 4 deletions
|
@ -339,8 +339,11 @@ class HKDevice:
|
||||||
@callback
|
@callback
|
||||||
def _async_schedule_update(self, now: datetime) -> None:
|
def _async_schedule_update(self, now: datetime) -> None:
|
||||||
"""Schedule an update."""
|
"""Schedule an update."""
|
||||||
self.hass.async_create_task(
|
self.config_entry.async_create_background_task(
|
||||||
self._debounced_update.async_call(), eager_start=True
|
self.hass,
|
||||||
|
self._debounced_update.async_call(),
|
||||||
|
name=f"hkc {self.unique_id} alive poll",
|
||||||
|
eager_start=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_add_new_entities(self) -> None:
|
async def async_add_new_entities(self) -> None:
|
||||||
|
@ -692,8 +695,8 @@ class HKDevice:
|
||||||
|
|
||||||
def process_config_changed(self, config_num: int) -> None:
|
def process_config_changed(self, config_num: int) -> None:
|
||||||
"""Handle a config change notification from the pairing."""
|
"""Handle a config change notification from the pairing."""
|
||||||
self.hass.async_create_task(
|
self.config_entry.async_create_task(
|
||||||
self.async_update_new_accessories_state(), eager_start=True
|
self.hass, self.async_update_new_accessories_state(), eager_start=True
|
||||||
)
|
)
|
||||||
|
|
||||||
async def async_update_new_accessories_state(self) -> None:
|
async def async_update_new_accessories_state(self) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue