Prevent updater from delaying startup (#35708)

* Prevent updater from delaying startup

The updater sometimes times out as seen in
#33833 and the linked issues. The issue was
presenting again today as it appears the service
is overloaded again.

* s/hass.loop/asyncio/g
This commit is contained in:
J. Nick Koston 2020-05-16 16:34:34 -05:00 committed by GitHub
parent 98523fbb61
commit fca96799a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,5 @@
"""Support to check for available updates."""
import asyncio
from datetime import timedelta
from distutils.version import StrictVersion
import logging
@ -105,7 +106,8 @@ async def async_setup(hass, config):
update_interval=timedelta(days=1),
)
await coordinator.async_refresh()
# This can take up to 15s which can delay startup
asyncio.create_task(coordinator.async_refresh())
hass.async_create_task(
discovery.async_load_platform(hass, "binary_sensor", DOMAIN, {}, config)