Sort imports according to PEP8 for yeelight (#29755)

pull/29787/head
Bas Nijholt 2019-12-09 13:10:24 +01:00 committed by Franck Nijhof
parent f81e608cc1
commit 3f469eac28
3 changed files with 44 additions and 41 deletions

View File

@ -1,24 +1,25 @@
"""Support for Xiaomi Yeelight WiFi color bulb."""
import logging
from datetime import timedelta
import logging
import voluptuous as vol
from yeelight import Bulb, BulbException
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.discovery import SERVICE_YEELIGHT
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_DEVICES,
CONF_HOST,
CONF_NAME,
CONF_SCAN_INTERVAL,
CONF_HOST,
ATTR_ENTITY_ID,
)
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.helpers import discovery
from homeassistant.helpers.discovery import load_platform
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import dispatcher_send, dispatcher_connect
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers.dispatcher import dispatcher_connect, dispatcher_send
from homeassistant.helpers.event import track_time_interval
_LOGGER = logging.getLogger(__name__)

View File

@ -4,7 +4,8 @@ import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import DATA_YEELIGHT, DATA_UPDATED
from . import DATA_UPDATED, DATA_YEELIGHT
_LOGGER = logging.getLogger(__name__)

View File

@ -4,60 +4,61 @@ import logging
import voluptuous as vol
import yeelight
from yeelight import (
BulbException,
Flow,
RGBTransition,
SleepTransition,
Flow,
BulbException,
transitions as yee_transitions,
)
from yeelight.enums import PowerMode, LightType, BulbType, SceneClass
from yeelight.enums import BulbType, LightType, PowerMode, SceneClass
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.service import extract_entity_ids
import homeassistant.helpers.config_validation as cv
from homeassistant.util.color import (
color_temperature_mired_to_kelvin as mired_to_kelvin,
color_temperature_kelvin_to_mired as kelvin_to_mired,
)
from homeassistant.const import CONF_HOST, ATTR_ENTITY_ID, ATTR_MODE, CONF_NAME
from homeassistant.core import callback
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_COLOR_TEMP,
ATTR_FLASH,
FLASH_SHORT,
FLASH_LONG,
ATTR_EFFECT,
ATTR_FLASH,
ATTR_HS_COLOR,
ATTR_KELVIN,
ATTR_RGB_COLOR,
ATTR_TRANSITION,
FLASH_LONG,
FLASH_SHORT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_TRANSITION,
SUPPORT_COLOR_TEMP,
SUPPORT_FLASH,
SUPPORT_EFFECT,
SUPPORT_FLASH,
SUPPORT_TRANSITION,
Light,
ATTR_RGB_COLOR,
ATTR_KELVIN,
)
from homeassistant.const import ATTR_ENTITY_ID, ATTR_MODE, CONF_HOST, CONF_NAME
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.service import extract_entity_ids
import homeassistant.util.color as color_util
from homeassistant.util.color import (
color_temperature_kelvin_to_mired as kelvin_to_mired,
color_temperature_mired_to_kelvin as mired_to_kelvin,
)
from . import (
CONF_TRANSITION,
DATA_YEELIGHT,
CONF_MODE_MUSIC,
CONF_SAVE_ON_CHANGE,
CONF_CUSTOM_EFFECTS,
DATA_UPDATED,
YEELIGHT_SERVICE_SCHEMA,
DOMAIN,
ATTR_TRANSITIONS,
YEELIGHT_FLOW_TRANSITION_SCHEMA,
ACTION_RECOVER,
CONF_FLOW_PARAMS,
ATTR_ACTION,
ATTR_COUNT,
NIGHTLIGHT_SWITCH_TYPE_LIGHT,
ATTR_TRANSITIONS,
CONF_CUSTOM_EFFECTS,
CONF_FLOW_PARAMS,
CONF_MODE_MUSIC,
CONF_NIGHTLIGHT_SWITCH_TYPE,
CONF_SAVE_ON_CHANGE,
CONF_TRANSITION,
DATA_UPDATED,
DATA_YEELIGHT,
DOMAIN,
NIGHTLIGHT_SWITCH_TYPE_LIGHT,
YEELIGHT_FLOW_TRANSITION_SCHEMA,
YEELIGHT_SERVICE_SCHEMA,
)
_LOGGER = logging.getLogger(__name__)