Change how we import config modules (#21824)

pull/21832/head
Paulus Schoutsen 2019-03-08 14:09:18 -08:00 committed by GitHub
parent ed6082eb2b
commit 22ab5a498f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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