Change how we import config modules (#21824)
parent
ed6082eb2b
commit
22ab5a498f
|
@ -1,13 +1,13 @@
|
|||
"""Component to configure Home Assistant via an API."""
|
||||
import asyncio
|
||||
import importlib
|
||||
import os
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.const import EVENT_COMPONENT_LOADED, CONF_ID
|
||||
from homeassistant.setup import (
|
||||
async_prepare_setup_platform, ATTR_COMPONENT)
|
||||
from homeassistant.setup import ATTR_COMPONENT
|
||||
from homeassistant.components.http import HomeAssistantView
|
||||
from homeassistant.util.yaml import load_yaml, dump
|
||||
|
||||
|
@ -36,8 +36,7 @@ async def async_setup(hass, config):
|
|||
|
||||
async def setup_panel(panel_name):
|
||||
"""Set up a panel."""
|
||||
panel = await async_prepare_setup_platform(
|
||||
hass, config, DOMAIN, panel_name)
|
||||
panel = importlib.import_module('.{}'.format(panel_name), __name__)
|
||||
|
||||
if not panel:
|
||||
return
|
||||
|
|
|
@ -8,8 +8,6 @@ from homeassistant.core import callback
|
|||
from homeassistant.helpers.area_registry import async_get_registry
|
||||
|
||||
|
||||
DEPENDENCIES = ['websocket_api']
|
||||
|
||||
WS_TYPE_LIST = 'config/area_registry/list'
|
||||
SCHEMA_WS_LIST = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend({
|
||||
vol.Required('type'): WS_TYPE_LIST,
|
||||
|
|
|
@ -7,8 +7,6 @@ from homeassistant.components.websocket_api.decorators import (
|
|||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.device_registry import async_get_registry
|
||||
|
||||
DEPENDENCIES = ['websocket_api']
|
||||
|
||||
WS_TYPE_LIST = 'config/device_registry/list'
|
||||
SCHEMA_WS_LIST = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend({
|
||||
vol.Required('type'): WS_TYPE_LIST,
|
||||
|
|
|
@ -9,8 +9,6 @@ from homeassistant.components.websocket_api.decorators import (
|
|||
async_response, require_admin)
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
|
||||
DEPENDENCIES = ['websocket_api']
|
||||
|
||||
WS_TYPE_LIST = 'config/entity_registry/list'
|
||||
SCHEMA_WS_LIST = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend({
|
||||
vol.Required('type'): WS_TYPE_LIST,
|
||||
|
|
Loading…
Reference in New Issue