Move imports to top for deconz (#29489)

This commit is contained in:
springstan 2019-12-05 06:17:18 +01:00 committed by Paulus Schoutsen
parent 8647ba3dd5
commit 89c7629215
8 changed files with 12 additions and 15 deletions

View file

@ -8,7 +8,7 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
from .deconz_device import DeconzDevice 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_ORIENTATION = "orientation"
ATTR_TILTANGLE = "tiltangle" ATTR_TILTANGLE = "tiltangle"

View file

@ -2,12 +2,12 @@
import asyncio import asyncio
import async_timeout 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 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 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.const import CONF_API_KEY, CONF_HOST, CONF_PORT
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client 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): async def async_step_ssdp(self, discovery_info):
"""Handle a discovered deCONZ bridge.""" """Handle a discovered deCONZ bridge."""
from homeassistant.components.ssdp import ATTR_MANUFACTURERURL, ATTR_SERIAL
if discovery_info[ATTR_MANUFACTURERURL] != DECONZ_MANUFACTURERURL: if discovery_info[ATTR_MANUFACTURERURL] != DECONZ_MANUFACTURERURL:
return self.async_abort(reason="not_deconz_bridge") return self.async_abort(reason="not_deconz_bridge")

View file

@ -1,11 +1,11 @@
"""Support for deCONZ covers.""" """Support for deCONZ covers."""
from homeassistant.components.cover import ( from homeassistant.components.cover import (
ATTR_POSITION, ATTR_POSITION,
CoverDevice,
SUPPORT_CLOSE, SUPPORT_CLOSE,
SUPPORT_OPEN, SUPPORT_OPEN,
SUPPORT_STOP,
SUPPORT_SET_POSITION, SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverDevice,
) )
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.helpers.dispatcher import async_dispatcher_connect

View file

@ -2,7 +2,6 @@
import voluptuous as vol import voluptuous as vol
import homeassistant.components.automation.event as event import homeassistant.components.automation.event as event
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.components.device_automation.exceptions import ( from homeassistant.components.device_automation.exceptions import (
InvalidDeviceAutomationConfig, InvalidDeviceAutomationConfig,

View file

@ -1,12 +1,12 @@
"""Representation of a deCONZ gateway.""" """Representation of a deCONZ gateway."""
import asyncio import asyncio
import async_timeout
import async_timeout
from pydeconz import DeconzSession, errors from pydeconz import DeconzSession, errors
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.const import CONF_HOST from homeassistant.const import CONF_HOST
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.dispatcher import ( from homeassistant.helpers.dispatcher import (
@ -14,8 +14,8 @@ from homeassistant.helpers.dispatcher import (
async_dispatcher_send, async_dispatcher_send,
) )
from homeassistant.helpers.entity_registry import ( from homeassistant.helpers.entity_registry import (
async_get_registry,
DISABLED_CONFIG_ENTRY, DISABLED_CONFIG_ENTRY,
async_get_registry,
) )
from .const import ( from .const import (
@ -30,7 +30,6 @@ from .const import (
NEW_DEVICE, NEW_DEVICE,
SUPPORTED_PLATFORMS, SUPPORTED_PLATFORMS,
) )
from .errors import AuthenticationRequired, CannotConnect from .errors import AuthenticationRequired, CannotConnect

View file

@ -29,7 +29,7 @@ from .const import (
SWITCH_TYPES, SWITCH_TYPES,
) )
from .deconz_device import DeconzDevice 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): async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):

View file

@ -11,7 +11,7 @@ from homeassistant.helpers.dispatcher import (
from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR from .const import ATTR_DARK, ATTR_ON, NEW_SENSOR
from .deconz_device import DeconzDevice from .deconz_device import DeconzDevice
from .deconz_event import DeconzEvent 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_CURRENT = "current"
ATTR_POWER = "power" ATTR_POWER = "power"

View file

@ -4,7 +4,7 @@ import voluptuous as vol
from homeassistant.helpers import config_validation as cv from homeassistant.helpers import config_validation as cv
from .config_flow import get_master_gateway 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" DECONZ_SERVICES = "deconz_services"