Skip to content

Commit

Permalink
Loading registries concurent with stage 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Swamp-Ig committed Mar 24, 2019
1 parent fc05829 commit d6b58f0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions homeassistant/bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
Expand Down Expand Up @@ -157,12 +158,20 @@ async def async_from_config_dict(config: Dict[str, Any],

await hass.async_block_till_done()

# Kick off loading the registries.
registries = 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:
hass.async_create_task(
async_setup_component(hass, component, config))

await registries

await hass.async_block_till_done()

# stage 2
Expand Down

0 comments on commit d6b58f0

Please sign in to comment.