mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 10:59:40 +00:00
Add setup function to the component loader (#98148)
* Add setup function to the component loader * Update test * Setup the loader in safe mode and in check_config script
This commit is contained in:
@@ -11,7 +11,7 @@ import os
|
||||
from typing import Any
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant import core
|
||||
from homeassistant import core, loader
|
||||
from homeassistant.config import get_default_config_dir
|
||||
from homeassistant.config_entries import ConfigEntries
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
@@ -232,6 +232,7 @@ def check(config_dir, secrets=False):
|
||||
async def async_check_config(config_dir):
|
||||
"""Check the HA config."""
|
||||
hass = core.HomeAssistant()
|
||||
loader.async_setup(hass)
|
||||
hass.config.config_dir = config_dir
|
||||
hass.config_entries = ConfigEntries(hass, {})
|
||||
await ar.async_load(hass)
|
||||
|
||||
Reference in New Issue
Block a user