mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Move imports to top for mysensors (#29517)
This commit is contained in:
parent
ec8ea02273
commit
b4fda5faab
@ -25,7 +25,7 @@ from .const import (
|
|||||||
MYSENSORS_GATEWAYS,
|
MYSENSORS_GATEWAYS,
|
||||||
)
|
)
|
||||||
from .device import get_mysensors_devices
|
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__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ from homeassistant.components.climate.const import (
|
|||||||
HVAC_MODE_AUTO,
|
HVAC_MODE_AUTO,
|
||||||
HVAC_MODE_COOL,
|
HVAC_MODE_COOL,
|
||||||
HVAC_MODE_HEAT,
|
HVAC_MODE_HEAT,
|
||||||
|
HVAC_MODE_OFF,
|
||||||
SUPPORT_FAN_MODE,
|
SUPPORT_FAN_MODE,
|
||||||
SUPPORT_TARGET_TEMPERATURE,
|
SUPPORT_TARGET_TEMPERATURE,
|
||||||
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||||
HVAC_MODE_OFF,
|
|
||||||
)
|
)
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""Handle MySensors devices."""
|
"""Handle MySensors devices."""
|
||||||
import logging
|
|
||||||
from functools import partial
|
from functools import partial
|
||||||
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON
|
from homeassistant.const import ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON
|
||||||
from homeassistant.core import callback
|
from homeassistant.core import callback
|
||||||
|
@ -6,6 +6,7 @@ import socket
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
from mysensors import mysensors
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import CONF_OPTIMISTIC, EVENT_HOMEASSISTANT_STOP
|
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):
|
async def _get_gateway(hass, config, gateway_conf, persistence_file):
|
||||||
"""Return gateway after setup of the gateway."""
|
"""Return gateway after setup of the gateway."""
|
||||||
from mysensors import mysensors
|
|
||||||
|
|
||||||
conf = config[DOMAIN]
|
conf = config[DOMAIN]
|
||||||
persistence = conf[CONF_PERSISTENCE]
|
persistence = conf[CONF_PERSISTENCE]
|
||||||
|
@ -5,7 +5,7 @@ from homeassistant.core import callback
|
|||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.util import decorator
|
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 .device import get_mysensors_devices
|
||||||
from .helpers import discover_mysensors_platform, validate_set_msg
|
from .helpers import discover_mysensors_platform, validate_set_msg
|
||||||
|
|
||||||
|
@ -11,8 +11,8 @@ from homeassistant.components.light import (
|
|||||||
Light,
|
Light,
|
||||||
)
|
)
|
||||||
from homeassistant.const import STATE_OFF, STATE_ON
|
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
|
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
|
SUPPORT_MYSENSORS_RGBW = SUPPORT_COLOR | SUPPORT_WHITE_VALUE
|
||||||
|
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
from homeassistant.components import mysensors
|
from homeassistant.components import mysensors
|
||||||
from homeassistant.components.sensor import DOMAIN
|
from homeassistant.components.sensor import DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
|
ENERGY_KILO_WATT_HOUR,
|
||||||
|
POWER_WATT,
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
TEMP_FAHRENHEIT,
|
TEMP_FAHRENHEIT,
|
||||||
POWER_WATT,
|
|
||||||
ENERGY_KILO_WATT_HOUR,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
SENSORS = {
|
SENSORS = {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
"""Support for MySensors switches."""
|
"""Support for MySensors switches."""
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.components import mysensors
|
from homeassistant.components import mysensors
|
||||||
from homeassistant.components.switch import DOMAIN, SwitchDevice
|
from homeassistant.components.switch import DOMAIN, SwitchDevice
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
|
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
|
from .const import DOMAIN as MYSENSORS_DOMAIN, SERVICE_SEND_IR_CODE
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user