Move imports to top for deconz (#29489)
parent
8647ba3dd5
commit
89c7629215
|
@ -8,7 +8,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
|||
|
||||
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
|
||||
from .deconz_device import DeconzDevice
|
||||
from .gateway import get_gateway_from_config_entry, DeconzEntityHandler
|
||||
from .gateway import DeconzEntityHandler, get_gateway_from_config_entry
|
||||
|
||||
ATTR_ORIENTATION = "orientation"
|
||||
ATTR_TILTANGLE = "tiltangle"
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
import asyncio
|
||||
|
||||
import async_timeout
|
||||
from pydeconz.errors import RequestError, ResponseError
|
||||
from pydeconz.utils import async_discovery, async_get_api_key, async_get_gateway_config
|
||||
import voluptuous as vol
|
||||
|
||||
from pydeconz.errors import ResponseError, RequestError
|
||||
from pydeconz.utils import async_discovery, async_get_api_key, async_get_gateway_config
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL, ATTR_SERIAL
|
||||
from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
|
@ -170,7 +170,6 @@ class DeconzFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
|
||||
async def async_step_ssdp(self, discovery_info):
|
||||
"""Handle a discovered deCONZ bridge."""
|
||||
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL, ATTR_SERIAL
|
||||
|
||||
if discovery_info[ATTR_MANUFACTURERURL] != DECONZ_MANUFACTURERURL:
|
||||
return self.async_abort(reason="not_deconz_bridge")
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
"""Support for deCONZ covers."""
|
||||
from homeassistant.components.cover import (
|
||||
ATTR_POSITION,
|
||||
CoverDevice,
|
||||
SUPPORT_CLOSE,
|
||||
SUPPORT_OPEN,
|
||||
SUPPORT_STOP,
|
||||
SUPPORT_SET_POSITION,
|
||||
SUPPORT_STOP,
|
||||
CoverDevice,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
import voluptuous as vol
|
||||
|
||||
import homeassistant.components.automation.event as event
|
||||
|
||||
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
|
||||
from homeassistant.components.device_automation.exceptions import (
|
||||
InvalidDeviceAutomationConfig,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
"""Representation of a deCONZ gateway."""
|
||||
import asyncio
|
||||
import async_timeout
|
||||
|
||||
import async_timeout
|
||||
from pydeconz import DeconzSession, errors
|
||||
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers import aiohttp_client
|
||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||
from homeassistant.helpers.dispatcher import (
|
||||
|
@ -14,8 +14,8 @@ from homeassistant.helpers.dispatcher import (
|
|||
async_dispatcher_send,
|
||||
)
|
||||
from homeassistant.helpers.entity_registry import (
|
||||
async_get_registry,
|
||||
DISABLED_CONFIG_ENTRY,
|
||||
async_get_registry,
|
||||
)
|
||||
|
||||
from .const import (
|
||||
|
@ -30,7 +30,6 @@ from .const import (
|
|||
NEW_DEVICE,
|
||||
SUPPORTED_PLATFORMS,
|
||||
)
|
||||
|
||||
from .errors import AuthenticationRequired, CannotConnect
|
||||
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ from .const import (
|
|||
SWITCH_TYPES,
|
||||
)
|
||||
from .deconz_device import DeconzDevice
|
||||
from .gateway import get_gateway_from_config_entry, DeconzEntityHandler
|
||||
from .gateway import DeconzEntityHandler, get_gateway_from_config_entry
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
|
|
|
@ -11,7 +11,7 @@ from homeassistant.helpers.dispatcher import (
|
|||
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
|
||||
from .deconz_device import DeconzDevice
|
||||
from .deconz_event import DeconzEvent
|
||||
from .gateway import get_gateway_from_config_entry, DeconzEntityHandler
|
||||
from .gateway import DeconzEntityHandler, get_gateway_from_config_entry
|
||||
|
||||
ATTR_CURRENT = "current"
|
||||
ATTR_POWER = "power"
|
||||
|
|
|
@ -4,7 +4,7 @@ import voluptuous as vol
|
|||
from homeassistant.helpers import config_validation as cv
|
||||
|
||||
from .config_flow import get_master_gateway
|
||||
from .const import CONF_BRIDGEID, DOMAIN, _LOGGER
|
||||
from .const import _LOGGER, CONF_BRIDGEID, DOMAIN
|
||||
|
||||
DECONZ_SERVICES = "deconz_services"
|
||||
|
||||
|
|
Loading…
Reference in New Issue