Fix lingering timer in elkm1 (#92517)

pull/92537/head
epenet 2023-05-04 19:03:26 +02:00 committed by GitHub
parent b6930c0f04
commit 4d77c6f27f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -188,7 +188,9 @@ async def async_setup(hass: HomeAssistant, hass_config: ConfigType) -> bool:
)
hass.async_create_background_task(_async_discovery(), "elkm1 setup discovery")
async_track_time_interval(hass, _async_discovery, DISCOVERY_INTERVAL)
async_track_time_interval(
hass, _async_discovery, DISCOVERY_INTERVAL, cancel_on_shutdown=True
)
if DOMAIN not in hass_config:
return True