Fix dangling task for elkm1 (#88286)

* Fix dangling task for elkm1

* Update homeassistant/components/elkm1/__init__.py

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
Paulus Schoutsen 2023-02-16 23:22:34 -05:00 committed by GitHub
parent 3212a43e6b
commit 509d968814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -187,7 +187,7 @@ async def async_setup(hass: HomeAssistant, hass_config: ConfigType) -> bool:
hass, await async_discover_devices(hass, DISCOVER_SCAN_TIMEOUT)
)
asyncio.create_task(_async_discovery())
hass.async_create_background_task(_async_discovery(), "elkm1 setup discovery")
async_track_time_interval(hass, _async_discovery, DISCOVERY_INTERVAL)
if DOMAIN not in hass_config: