mirror of
https://github.com/home-assistant/core.git
synced 2025-04-19 14:57:52 +00:00
Adjust registry access in scripts (#88884)
This commit is contained in:
parent
54f709f704
commit
ee781e4f49
@ -15,7 +15,11 @@ from homeassistant import core
|
||||
from homeassistant.config import get_default_config_dir
|
||||
from homeassistant.config_entries import ConfigEntries
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import area_registry, device_registry, entity_registry
|
||||
from homeassistant.helpers import (
|
||||
area_registry as ar,
|
||||
device_registry as dr,
|
||||
entity_registry as er,
|
||||
)
|
||||
from homeassistant.helpers.check_config import async_check_ha_config_file
|
||||
from homeassistant.util.yaml import Secrets
|
||||
import homeassistant.util.yaml.loader as yaml_loader
|
||||
@ -230,9 +234,9 @@ async def async_check_config(config_dir):
|
||||
hass = core.HomeAssistant()
|
||||
hass.config.config_dir = config_dir
|
||||
hass.config_entries = ConfigEntries(hass, {})
|
||||
await area_registry.async_load(hass)
|
||||
await device_registry.async_load(hass)
|
||||
await entity_registry.async_load(hass)
|
||||
await ar.async_load(hass)
|
||||
await dr.async_load(hass)
|
||||
await er.async_load(hass)
|
||||
components = await async_check_ha_config_file(hass)
|
||||
await hass.async_stop(force=True)
|
||||
return components
|
||||
|
Loading…
x
Reference in New Issue
Block a user