Use relative imports inside integrations (#22235)
* Use relative imports inside integrations * Lint * Fix automation tests * Fix scene imports
This commit is contained in:
1 parent
ab17b22239
commit
4b1de61110
522 files changed
+1834
-1725
No files matched your search
@@ -5,8 +5,7 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON)
|
||||
from homeassistant.const import ATTR_ENTITY_ID, CONF_PLATFORM, SERVICE_TURN_ON
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
@@ -28,9 +27,8 @@ def _hass_domain_validator(config):
|
||||
def _platform_validator(config):
|
||||
"""Validate it is a valid platform."""
|
||||
try:
|
||||
platform = importlib.import_module(
|
||||
'homeassistant.components.scene.{}'.format(
|
||||
config[CONF_PLATFORM]))
|
||||
platform = importlib.import_module('.{}'.format(config[CONF_PLATFORM]),
|
||||
__name__)
|
||||
except ImportError:
|
||||
try:
|
||||
platform = importlib.import_module(
|
||||
|
||||
Reference in new issue
Block a user