Sort import order of zha component. (#18993)

This commit is contained in:
Alexei Chetroi 2018-12-04 05:38:57 -05:00 committed by Paulus Schoutsen
parent 2a0c2d5247
commit 3e1ab1b23a
11 changed files with 45 additions and 48 deletions

View File

@ -7,12 +7,11 @@ at https://home-assistant.io/components/binary_sensor.zha/
import logging import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.components.zha import helpers from homeassistant.components.zha import helpers
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.zha.const import ( from homeassistant.components.zha.const import (
ZHA_DISCOVERY_NEW, DATA_ZHA, DATA_ZHA_DISPATCHERS DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW)
) from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.helpers.dispatcher import async_dispatcher_connect
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -5,15 +5,15 @@ For more details on this platform, please refer to the documentation
at https://home-assistant.io/components/fan.zha/ at https://home-assistant.io/components/fan.zha/
""" """
import logging import logging
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.components.zha import helpers
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.zha.const import (
ZHA_DISCOVERY_NEW, DATA_ZHA, DATA_ZHA_DISPATCHERS
)
from homeassistant.components.fan import ( from homeassistant.components.fan import (
DOMAIN, FanEntity, SPEED_OFF, SPEED_LOW, SPEED_MEDIUM, SPEED_HIGH, DOMAIN, SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SPEED_OFF, SUPPORT_SET_SPEED,
SUPPORT_SET_SPEED) FanEntity)
from homeassistant.components.zha import helpers
from homeassistant.components.zha.const import (
DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW)
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.helpers.dispatcher import async_dispatcher_connect
DEPENDENCIES = ['zha'] DEPENDENCIES = ['zha']

View File

@ -5,13 +5,13 @@ For more details on this platform, please refer to the documentation
at https://home-assistant.io/components/light.zha/ at https://home-assistant.io/components/light.zha/
""" """
import logging import logging
from homeassistant.components import light from homeassistant.components import light
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.components.zha import helpers from homeassistant.components.zha import helpers
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.zha.const import ( from homeassistant.components.zha.const import (
ZHA_DISCOVERY_NEW, DATA_ZHA, DATA_ZHA_DISPATCHERS DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW)
) from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.helpers.dispatcher import async_dispatcher_connect
import homeassistant.util.color as color_util import homeassistant.util.color as color_util
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -7,13 +7,12 @@ at https://home-assistant.io/components/sensor.zha/
import logging import logging
from homeassistant.components.sensor import DOMAIN from homeassistant.components.sensor import DOMAIN
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.components.zha import helpers from homeassistant.components.zha import helpers
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.zha.const import ( from homeassistant.components.zha.const import (
ZHA_DISCOVERY_NEW, DATA_ZHA, DATA_ZHA_DISPATCHERS DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW)
) from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.const import TEMP_CELSIUS from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util.temperature import convert as convert_temperature from homeassistant.util.temperature import convert as convert_temperature
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -6,13 +6,12 @@ at https://home-assistant.io/components/switch.zha/
""" """
import logging import logging
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.components.switch import DOMAIN, SwitchDevice from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.components.zha import helpers from homeassistant.components.zha import helpers
from homeassistant.components.zha.const import ( from homeassistant.components.zha.const import (
ZHA_DISCOVERY_NEW, DATA_ZHA, DATA_ZHA_DISPATCHERS DATA_ZHA, DATA_ZHA_DISPATCHERS, ZHA_DISCOVERY_NEW)
) from homeassistant.components.zha.entities import ZhaEntity
from homeassistant.helpers.dispatcher import async_dispatcher_connect
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)

View File

@ -10,23 +10,22 @@ import os
import voluptuous as vol import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.components.zha.entities import ZhaDeviceEntity
from homeassistant import config_entries, const as ha_const from homeassistant import config_entries, const as ha_const
from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.components.zha.entities import ZhaDeviceEntity
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from . import const as zha_const from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity_component import EntityComponent
# Loading the config flow file will register the flow # Loading the config flow file will register the flow
from . import config_flow # noqa # pylint: disable=unused-import from . import config_flow # noqa # pylint: disable=unused-import
from . import const as zha_const
from .const import ( from .const import (
DOMAIN, COMPONENTS, CONF_BAUDRATE, CONF_DATABASE, CONF_RADIO_TYPE, COMPONENTS, CONF_BAUDRATE, CONF_DATABASE, CONF_DEVICE_CONFIG,
CONF_USB_PATH, CONF_DEVICE_CONFIG, ZHA_DISCOVERY_NEW, DATA_ZHA, CONF_RADIO_TYPE, CONF_USB_PATH, DATA_ZHA, DATA_ZHA_BRIDGE_ID,
DATA_ZHA_CONFIG, DATA_ZHA_BRIDGE_ID, DATA_ZHA_RADIO, DATA_ZHA_DISPATCHERS, DATA_ZHA_CONFIG, DATA_ZHA_CORE_COMPONENT, DATA_ZHA_DISPATCHERS,
DATA_ZHA_CORE_COMPONENT, DEFAULT_RADIO_TYPE, DEFAULT_DATABASE_NAME, DATA_ZHA_RADIO, DEFAULT_BAUDRATE, DEFAULT_DATABASE_NAME,
DEFAULT_BAUDRATE, RadioType DEFAULT_RADIO_TYPE, DOMAIN, ZHA_DISCOVERY_NEW, RadioType)
)
REQUIREMENTS = [ REQUIREMENTS = [
'bellows==0.7.0', 'bellows==0.7.0',

View File

@ -1,14 +1,14 @@
"""Config flow for ZHA.""" """Config flow for ZHA."""
import os
from collections import OrderedDict from collections import OrderedDict
import os
import voluptuous as vol import voluptuous as vol
from homeassistant import config_entries from homeassistant import config_entries
from .helpers import check_zigpy_connection
from .const import ( from .const import (
DOMAIN, CONF_RADIO_TYPE, CONF_USB_PATH, DEFAULT_DATABASE_NAME, RadioType CONF_RADIO_TYPE, CONF_USB_PATH, DEFAULT_DATABASE_NAME, DOMAIN, RadioType)
) from .helpers import check_zigpy_connection
@config_entries.HANDLERS.register(DOMAIN) @config_entries.HANDLERS.register(DOMAIN)

View File

@ -6,5 +6,5 @@ https://home-assistant.io/components/zha/
""" """
# flake8: noqa # flake8: noqa
from .entity import ZhaEntity
from .device_entity import ZhaDeviceEntity from .device_entity import ZhaDeviceEntity
from .entity import ZhaEntity

View File

@ -6,6 +6,7 @@ https://home-assistant.io/components/zha/
""" """
import time import time
from homeassistant.helpers import entity from homeassistant.helpers import entity
from homeassistant.util import slugify from homeassistant.util import slugify

View File

@ -4,13 +4,12 @@ Entity for Zigbee Home Automation.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/ https://home-assistant.io/components/zha/
""" """
from homeassistant.helpers import entity
from homeassistant.util import slugify
from homeassistant.core import callback
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from homeassistant.components.zha.const import ( from homeassistant.components.zha.const import (
DOMAIN, DATA_ZHA, DATA_ZHA_BRIDGE_ID DATA_ZHA, DATA_ZHA_BRIDGE_ID, DOMAIN)
) from homeassistant.core import callback
from homeassistant.helpers import entity
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE
from homeassistant.util import slugify
class ZhaEntity(entity.Entity): class ZhaEntity(entity.Entity):

View File

@ -4,9 +4,10 @@ Helpers for Zigbee Home Automation.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/ https://home-assistant.io/components/zha/
""" """
import logging
import asyncio import asyncio
from .const import RadioType, DEFAULT_BAUDRATE import logging
from .const import DEFAULT_BAUDRATE, RadioType
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)