Bootstrap to start registry loading early (#22321)

* Registries store directly in data on loading.

* Loading registries concurent with stage 1.

* Removed comments
This commit is contained in:
Penny Wood authored and GitHub committed 2019-03-27 22:06:20 +08:00
1 parent 4de2efd07f
commit 646c4a7137
5 files changed
+67 -44

No files matched your search

+7
View File
@@ -1,4 +1,5 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
@@ -157,6 +158,12 @@ async def async_from_config_dict(config: Dict[str, Any],
await hass.async_block_till_done()
# Kick off loading the registries. They don't need to be awaited.
asyncio.gather(
hass.helpers.device_registry.async_get_registry(),
hass.helpers.entity_registry.async_get_registry(),
hass.helpers.area_registry.async_get_registry())
# stage 1
for component in components:
if component in FIRST_INIT_COMPONENT: