mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Fix demo (#23087)
* Fix demo * Fix types * Fix all the things * Fix type * Fix test * Lint
This commit is contained in:
@@ -11,9 +11,6 @@ from typing import Any, Optional, Dict, Set
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import core, config as conf_util, config_entries, loader
|
||||
from homeassistant.components import (
|
||||
persistent_notification, homeassistant as core_component
|
||||
)
|
||||
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
|
||||
from homeassistant.setup import async_setup_component
|
||||
from homeassistant.util.logging import AsyncHandler
|
||||
@@ -139,17 +136,18 @@ async def async_from_config_dict(config: Dict[str, Any],
|
||||
if isinstance(dep_domains, set):
|
||||
domains.update(dep_domains)
|
||||
|
||||
# setup components
|
||||
res = await core_component.async_setup(hass, config)
|
||||
if not res:
|
||||
# Set up core.
|
||||
if not all(await asyncio.gather(
|
||||
async_setup_component(hass, 'homeassistant', config),
|
||||
async_setup_component(hass, 'persistent_notification', config),
|
||||
)):
|
||||
_LOGGER.error("Home Assistant core failed to initialize. "
|
||||
"Further initialization aborted")
|
||||
return hass
|
||||
|
||||
await persistent_notification.async_setup(hass, config)
|
||||
|
||||
_LOGGER.info("Home Assistant core initialized")
|
||||
_LOGGER.debug("Home Assistant core initialized")
|
||||
|
||||
# setup components
|
||||
# stage 0, load logging components
|
||||
for domain in domains:
|
||||
if domain in LOGGING_COMPONENT:
|
||||
|
||||
Reference in New Issue
Block a user