1
mirror of https://github.com/home-assistant/core synced 2024-09-25 00:41:32 +02:00

Adjust registry access in scripts (#88884)

This commit is contained in:
epenet 2023-03-01 03:58:47 +01:00 committed by GitHub
parent 54f709f704
commit ee781e4f49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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