mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Load network storage in a task to reduce startup time (#112460)
We waited for these in series but they are not dependant on each other
This commit is contained in:
parent
9be4fb0574
commit
2c13a81086
@ -7,6 +7,7 @@ from typing import Any
|
|||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.singleton import singleton
|
from homeassistant.helpers.singleton import singleton
|
||||||
from homeassistant.helpers.storage import Store
|
from homeassistant.helpers.storage import Store
|
||||||
|
from homeassistant.util.async_ import create_eager_task
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_CONFIGURED_ADAPTERS,
|
ATTR_CONFIGURED_ADAPTERS,
|
||||||
@ -50,8 +51,9 @@ class Network:
|
|||||||
|
|
||||||
async def async_setup(self) -> None:
|
async def async_setup(self) -> None:
|
||||||
"""Set up the network config."""
|
"""Set up the network config."""
|
||||||
await self.async_load()
|
storage_load_task = create_eager_task(self.async_load())
|
||||||
self.adapters = await async_load_adapters()
|
self.adapters = await async_load_adapters()
|
||||||
|
await storage_load_task
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_configure(self) -> None:
|
def async_configure(self) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user