From b4fda5faab72ed8bf9678067c3be17ec9b806cd1 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Thu, 5 Dec 2019 19:54:43 +0100 Subject: [PATCH] Move imports to top for mysensors (#29517) --- homeassistant/components/mysensors/__init__.py | 2 +- homeassistant/components/mysensors/climate.py | 2 +- homeassistant/components/mysensors/device.py | 2 +- homeassistant/components/mysensors/gateway.py | 2 +- homeassistant/components/mysensors/handler.py | 2 +- homeassistant/components/mysensors/light.py | 2 +- homeassistant/components/mysensors/sensor.py | 4 ++-- homeassistant/components/mysensors/switch.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/mysensors/__init__.py b/homeassistant/components/mysensors/__init__.py index cbedd947843..a528be15e14 100644 --- a/homeassistant/components/mysensors/__init__.py +++ b/homeassistant/components/mysensors/__init__.py @@ -25,7 +25,7 @@ from .const import ( MYSENSORS_GATEWAYS, ) from .device import get_mysensors_devices -from .gateway import get_mysensors_gateway, setup_gateways, finish_setup +from .gateway import finish_setup, get_mysensors_gateway, setup_gateways _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/mysensors/climate.py b/homeassistant/components/mysensors/climate.py index dc053e60de1..4939c0c83e5 100644 --- a/homeassistant/components/mysensors/climate.py +++ b/homeassistant/components/mysensors/climate.py @@ -8,10 +8,10 @@ from homeassistant.components.climate.const import ( HVAC_MODE_AUTO, HVAC_MODE_COOL, HVAC_MODE_HEAT, + HVAC_MODE_OFF, SUPPORT_FAN_MODE, SUPPORT_TARGET_TEMPERATURE, SUPPORT_TARGET_TEMPERATURE_RANGE, - HVAC_MODE_OFF, ) from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT diff --git a/homeassistant/components/mysensors/device.py b/homeassistant/components/mysensors/device.py index 6d766530b04..e5853fce5ca 100644 --- a/homeassistant/components/mysensors/device.py +++ b/homeassistant/components/mysensors/device.py @@ -1,6 +1,6 @@ """Handle MySensors devices.""" -import logging from functools import partial +import logging from homeassistant.const import ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON from homeassistant.core import callback diff --git a/homeassistant/components/mysensors/gateway.py b/homeassistant/components/mysensors/gateway.py index 366692205a7..903ec069b51 100644 --- a/homeassistant/components/mysensors/gateway.py +++ b/homeassistant/components/mysensors/gateway.py @@ -6,6 +6,7 @@ import socket import sys import async_timeout +from mysensors import mysensors import voluptuous as vol from homeassistant.const import CONF_OPTIMISTIC, EVENT_HOMEASSISTANT_STOP @@ -84,7 +85,6 @@ async def setup_gateways(hass, config): async def _get_gateway(hass, config, gateway_conf, persistence_file): """Return gateway after setup of the gateway.""" - from mysensors import mysensors conf = config[DOMAIN] persistence = conf[CONF_PERSISTENCE] diff --git a/homeassistant/components/mysensors/handler.py b/homeassistant/components/mysensors/handler.py index 0923b6bc8de..31e836f4767 100644 --- a/homeassistant/components/mysensors/handler.py +++ b/homeassistant/components/mysensors/handler.py @@ -5,7 +5,7 @@ from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_send from homeassistant.util import decorator -from .const import MYSENSORS_GATEWAY_READY, CHILD_CALLBACK, NODE_CALLBACK +from .const import CHILD_CALLBACK, MYSENSORS_GATEWAY_READY, NODE_CALLBACK from .device import get_mysensors_devices from .helpers import discover_mysensors_platform, validate_set_msg diff --git a/homeassistant/components/mysensors/light.py b/homeassistant/components/mysensors/light.py index 8f0d0906311..19eb8e9e92c 100644 --- a/homeassistant/components/mysensors/light.py +++ b/homeassistant/components/mysensors/light.py @@ -11,8 +11,8 @@ from homeassistant.components.light import ( Light, ) from homeassistant.const import STATE_OFF, STATE_ON -from homeassistant.util.color import rgb_hex_to_rgb_list import homeassistant.util.color as color_util +from homeassistant.util.color import rgb_hex_to_rgb_list SUPPORT_MYSENSORS_RGBW = SUPPORT_COLOR | SUPPORT_WHITE_VALUE diff --git a/homeassistant/components/mysensors/sensor.py b/homeassistant/components/mysensors/sensor.py index a7d1cad98fa..ddad451d20f 100644 --- a/homeassistant/components/mysensors/sensor.py +++ b/homeassistant/components/mysensors/sensor.py @@ -2,10 +2,10 @@ from homeassistant.components import mysensors from homeassistant.components.sensor import DOMAIN from homeassistant.const import ( + ENERGY_KILO_WATT_HOUR, + POWER_WATT, TEMP_CELSIUS, TEMP_FAHRENHEIT, - POWER_WATT, - ENERGY_KILO_WATT_HOUR, ) SENSORS = { diff --git a/homeassistant/components/mysensors/switch.py b/homeassistant/components/mysensors/switch.py index fecec53370b..ec28649d70f 100644 --- a/homeassistant/components/mysensors/switch.py +++ b/homeassistant/components/mysensors/switch.py @@ -1,10 +1,10 @@ """Support for MySensors switches.""" import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant.components import mysensors from homeassistant.components.switch import DOMAIN, SwitchDevice from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON +import homeassistant.helpers.config_validation as cv from .const import DOMAIN as MYSENSORS_DOMAIN, SERVICE_SEND_IR_CODE