sync with HA/core PR

This commit is contained in:
Bas Nijholt 2020-09-26 17:39:17 +02:00
commit 52fa727c75
4 changed files with 10 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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)