diff --git a/custom_components/adaptive_lighting/__init__.py b/custom_components/adaptive_lighting/__init__.py index 0a053fb0..9e6f5c9c 100755 --- a/custom_components/adaptive_lighting/__init__.py +++ b/custom_components/adaptive_lighting/__init__.py @@ -29,8 +29,8 @@ import logging import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry +import homeassistant.helpers.config_validation as cv from .const import _DOMAIN_SCHEMA, CONF_NAME, DOMAIN, UNDO_UPDATE_LISTENER diff --git a/custom_components/adaptive_lighting/config_flow.py b/custom_components/adaptive_lighting/config_flow.py index ba3e8a04..b261a71d 100644 --- a/custom_components/adaptive_lighting/config_flow.py +++ b/custom_components/adaptive_lighting/config_flow.py @@ -3,9 +3,9 @@ import logging import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant import config_entries from homeassistant.core import callback +import homeassistant.helpers.config_validation as cv from .const import CONF_LIGHTS, DOMAIN, EXTRA_VALIDATION, NONE_STR, VALIDATION_TUPLES diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index 228689c0..0c449a10 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -1,8 +1,8 @@ """Constants for the Adaptive Lighting Component in Home-Assistant.""" import voluptuous as vol -import homeassistant.helpers.config_validation as cv from homeassistant.components.light import VALID_TRANSITION +import homeassistant.helpers.config_validation as cv ICON = "mdi:theme-light-dark" diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 74319e14..d5f4aacb 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -2,22 +2,18 @@ import asyncio import bisect -import logging from copy import deepcopy from datetime import timedelta +import logging import voluptuous as vol -import homeassistant.helpers.config_validation as cv -import homeassistant.util.dt as dt_util from homeassistant.components.light import ( ATTR_BRIGHTNESS_PCT, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION, -) -from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN -from homeassistant.components.light import ( + DOMAIN as LIGHT_DOMAIN, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, @@ -35,6 +31,7 @@ from homeassistant.const import ( SUN_EVENT_SUNSET, ) from homeassistant.helpers import entity_platform +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.event import ( async_track_state_change, async_track_time_interval, @@ -48,6 +45,7 @@ from homeassistant.util.color import ( color_temperature_to_rgb, color_xy_to_hs, ) +import homeassistant.util.dt as dt_util from .const import ( CONF_COLORS_ONLY, @@ -104,7 +102,9 @@ async def handle_apply(switch, service_call): data = service_call.data tasks = [ await switch._adjust_light( - light, data[CONF_TRANSITION], data[CONF_COLORS_ONLY], + light, + data[CONF_TRANSITION], + data[CONF_COLORS_ONLY], ) for light in data[CONF_LIGHTS] if not data[CONF_ON_LIGHTS_ONLY] or is_on(switch.hass, light)