Fix dangling task for unifiprotect (#88300)

pull/88304/head
Paulus Schoutsen 2023-02-16 23:05:06 -05:00 committed by GitHub
parent a26d41f260
commit a5170340a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -1,7 +1,6 @@
"""The unifiprotect integration discovery."""
from __future__ import annotations
import asyncio
from dataclasses import asdict
from datetime import timedelta
import logging
@ -34,7 +33,7 @@ def async_start_discovery(hass: HomeAssistant) -> None:
async_trigger_discovery(hass, await async_discover_devices())
# Do not block startup since discovery takes 31s or more
asyncio.create_task(_async_discovery())
hass.async_create_background_task(_async_discovery(), "unifiprotect-discovery")
async_track_time_interval(hass, _async_discovery, DISCOVERY_INTERVAL)