mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-12 06:44:04 +02:00
rename disable_color -> disable_color_adjust
This commit is contained in:
parent
199d31b891
commit
869ff917e0
4 changed files with 7 additions and 5 deletions
|
|
@ -12,11 +12,11 @@ SUN_EVENT_MIDNIGHT = "solar_midnight"
|
|||
|
||||
CONF_NAME, DEFAULT_NAME = "name", "default"
|
||||
CONF_LIGHTS, DEFAULT_LIGHTS = "lights", []
|
||||
CONF_DISABLE_COLOR, DEFAULT_DISABLE_COLOR = "disable_color", False
|
||||
CONF_DISABLE_BRIGHTNESS_ADJUST, DEFAULT_DISABLE_BRIGHTNESS_ADJUST = (
|
||||
"disable_brightness_adjust",
|
||||
False,
|
||||
)
|
||||
CONF_DISABLE_COLOR_ADJUST, DEFAULT_DISABLE_COLOR_ADJUST = "disable_color_adjust", False
|
||||
CONF_DISABLE_ENTITY = "disable_entity"
|
||||
CONF_DISABLE_STATE = "disable_state"
|
||||
CONF_INITIAL_TRANSITION, DEFAULT_INITIAL_TRANSITION = "initial_transition", 1
|
||||
|
|
@ -53,8 +53,8 @@ def int_between(a, b):
|
|||
|
||||
VALIDATION_TUPLES = [
|
||||
(CONF_LIGHTS, DEFAULT_LIGHTS, cv.entity_ids),
|
||||
(CONF_DISABLE_COLOR, DEFAULT_DISABLE_COLOR, bool),
|
||||
(CONF_DISABLE_BRIGHTNESS_ADJUST, DEFAULT_DISABLE_BRIGHTNESS_ADJUST, bool),
|
||||
(CONF_DISABLE_COLOR_ADJUST, DEFAULT_DISABLE_COLOR_ADJUST, bool),
|
||||
(CONF_DISABLE_ENTITY, NONE_STR, cv.entity_id),
|
||||
(CONF_DISABLE_STATE, NONE_STR, str),
|
||||
(CONF_INITIAL_TRANSITION, DEFAULT_INITIAL_TRANSITION, VALID_TRANSITION),
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
"data": {
|
||||
"lights": "lights",
|
||||
"disable_brightness_adjust": "disable_brightness_adjust",
|
||||
"disable_color_adjust": "disable_color_adjust",
|
||||
"disable_entity": "disable_entity",
|
||||
"disable_state": "disable_state",
|
||||
"initial_transition": "initial_transition, the transition of the lights when turning them on or when 'disable_state' or 'sleep_state' change",
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import homeassistant.util.dt as dt_util
|
|||
from .const import (
|
||||
CONF_COLORS_ONLY,
|
||||
CONF_DISABLE_BRIGHTNESS_ADJUST,
|
||||
CONF_DISABLE_COLOR,
|
||||
CONF_DISABLE_COLOR_ADJUST,
|
||||
CONF_DISABLE_ENTITY,
|
||||
CONF_DISABLE_STATE,
|
||||
CONF_INITIAL_TRANSITION,
|
||||
|
|
@ -166,7 +166,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
self._name = data[CONF_NAME]
|
||||
self._lights = data[CONF_LIGHTS]
|
||||
self._disable_brightness_adjust = data[CONF_DISABLE_BRIGHTNESS_ADJUST]
|
||||
self._disable_color = data[CONF_DISABLE_COLOR]
|
||||
self._disable_color_adjust = data[CONF_DISABLE_COLOR_ADJUST]
|
||||
self._disable_entity = data[CONF_DISABLE_ENTITY]
|
||||
self._disable_state = data[CONF_DISABLE_STATE]
|
||||
self._initial_transition = data[CONF_INITIAL_TRANSITION]
|
||||
|
|
@ -444,7 +444,7 @@ class AdaptiveSwitch(SwitchEntity, RestoreEntity):
|
|||
):
|
||||
service_data[ATTR_BRIGHTNESS_PCT] = self._brightness
|
||||
|
||||
if "color" in features and not self._disable_color:
|
||||
if "color" in features and not self._disable_color_adjust:
|
||||
service_data[ATTR_RGB_COLOR] = self._rgb_color
|
||||
elif "color_temp" in features:
|
||||
service_data[ATTR_COLOR_TEMP] = self._color_temp_mired
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
"data": {
|
||||
"lights": "lights",
|
||||
"disable_brightness_adjust": "disable_brightness_adjust",
|
||||
"disable_color_adjust": "disable_color_adjust",
|
||||
"disable_entity": "disable_entity",
|
||||
"disable_state": "disable_state",
|
||||
"initial_transition": "initial_transition, the transition of the lights when turning them on or when 'disable_state' or 'sleep_state' change",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue