diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index 15714e6f..faef738b 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -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), diff --git a/custom_components/adaptive_lighting/strings.json b/custom_components/adaptive_lighting/strings.json index 1bea6ab5..b871aac9 100644 --- a/custom_components/adaptive_lighting/strings.json +++ b/custom_components/adaptive_lighting/strings.json @@ -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", diff --git a/custom_components/adaptive_lighting/switch.py b/custom_components/adaptive_lighting/switch.py index 1e328053..6a9a05dd 100755 --- a/custom_components/adaptive_lighting/switch.py +++ b/custom_components/adaptive_lighting/switch.py @@ -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 diff --git a/custom_components/adaptive_lighting/translations/en.json b/custom_components/adaptive_lighting/translations/en.json index 1bea6ab5..b871aac9 100644 --- a/custom_components/adaptive_lighting/translations/en.json +++ b/custom_components/adaptive_lighting/translations/en.json @@ -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",