Fix dangling task for wiz (#88301)

This commit is contained in:
Paulus Schoutsen
2023-02-17 09:29:46 -05:00
committed by GitHub
parent 9989a4787b
commit f3e4783a5e

View File

@@ -1,7 +1,6 @@
"""WiZ Platform integration.""" """WiZ Platform integration."""
from __future__ import annotations from __future__ import annotations
import asyncio
from datetime import timedelta from datetime import timedelta
import logging import logging
from typing import Any from typing import Any
@@ -51,7 +50,7 @@ async def async_setup(hass: HomeAssistant, hass_config: ConfigType) -> bool:
hass, await async_discover_devices(hass, DISCOVER_SCAN_TIMEOUT) hass, await async_discover_devices(hass, DISCOVER_SCAN_TIMEOUT)
) )
asyncio.create_task(_async_discovery()) hass.async_create_background_task(_async_discovery(), "wiz-discovery")
async_track_time_interval(hass, _async_discovery, DISCOVERY_INTERVAL) async_track_time_interval(hass, _async_discovery, DISCOVERY_INTERVAL)
return True return True