add percent

This commit is contained in:
Bas Nijholt 2020-10-20 00:06:10 +02:00
commit 7555638b6f
2 changed files with 4 additions and 1 deletions

View file

@ -36,6 +36,7 @@ CONF_SUNSET_TIME = "sunset_time"
CONF_TAKE_OVER_CONTROL, DEFAULT_TAKE_OVER_CONTROL = "take_over_control", True
CONF_TRANSITION, DEFAULT_TRANSITION = "transition", 45
SLEEP_MODE_SWITCH = "sleep_mode_switch"
ATTR_TURN_ON_OFF_LISTENER = "turn_on_off_listener"
UNDO_UPDATE_LISTENER = "undo_update_listener"
NONE_STR = "None"

View file

@ -102,6 +102,7 @@ from .const import (
ICON,
SERVICE_APPLY,
SERVICE_SET_MANUAL_CONTROL,
SLEEP_MODE_SWITCH,
SUN_EVENT_MIDNIGHT,
SUN_EVENT_NOON,
TURNING_OFF_DELAY,
@ -216,7 +217,7 @@ async def async_setup_entry(
sleep_mode_switch = AdaptiveSleepModeSwitch(hass, config_entry)
switch = AdaptiveSwitch(hass, config_entry, turn_on_off_listener, sleep_mode_switch)
data[config_entry.entry_id]["sleep_mode_switch"] = sleep_mode_switch
data[config_entry.entry_id][SLEEP_MODE_SWITCH] = sleep_mode_switch
data[config_entry.entry_id][SWITCH_DOMAIN] = switch
async_add_entities([switch, sleep_mode_switch], update_before_add=True)
@ -987,6 +988,7 @@ class SunLightSettings:
"rgb_color": rgb_color,
"xy_color": xy_color,
"hs_color": hs_color,
"sun_position": percent,
}