From d3dce3166ed265fa49912af925ed1ba801493e8b Mon Sep 17 00:00:00 2001 From: Bas Nijholt Date: Wed, 31 Aug 2022 22:05:31 -0700 Subject: [PATCH] Add strings and options --- custom_components/adaptive_lighting/const.py | 5 +++++ custom_components/adaptive_lighting/strings.json | 2 ++ 2 files changed, 7 insertions(+) diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index e860fa74..fc767408 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -32,6 +32,10 @@ CONF_SEPARATE_TURN_ON_COMMANDS, DEFAULT_SEPARATE_TURN_ON_COMMANDS = ( CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS = "sleep_brightness", 1 CONF_SLEEP_COLOR_TEMP, DEFAULT_SLEEP_COLOR_TEMP = "sleep_color_temp", 1000 CONF_SLEEP_RGB_COLOR, DEFAULT_SLEEP_RGB_COLOR = "sleep_rgb_color", [255, 56, 0] +CONF_SLEEP_RGB_OR_COLOR_TEMP, DEFAULT_SLEEP_RGB_OR_COLOR_TEMP = ( + "sleep_rgb_or_color_temp", + "color_temp", +) CONF_SUNRISE_OFFSET, DEFAULT_SUNRISE_OFFSET = "sunrise_offset", 0 CONF_SUNRISE_TIME = "sunrise_time" CONF_SUNSET_OFFSET, DEFAULT_SUNSET_OFFSET = "sunset_offset", 0 @@ -80,6 +84,7 @@ VALIDATION_TUPLES = [ DEFAULT_SLEEP_RGB_COLOR, selector.ColorRGBSelector(selector.ColorRGBSelectorConfig()), ), + (CONF_SLEEP_RGB_OR_COLOR_TEMP, DEFAULT_SLEEP_RGB_OR_COLOR_TEMP, bool), (CONF_SUNRISE_TIME, NONE_STR, str), (CONF_SUNRISE_OFFSET, DEFAULT_SUNRISE_OFFSET, int), (CONF_SUNSET_TIME, NONE_STR, str), diff --git a/custom_components/adaptive_lighting/strings.json b/custom_components/adaptive_lighting/strings.json index 5a185ea3..c20335bc 100644 --- a/custom_components/adaptive_lighting/strings.json +++ b/custom_components/adaptive_lighting/strings.json @@ -31,7 +31,9 @@ "prefer_rgb_color": "prefer_rgb_color, use 'rgb_color' over 'color_temp' when possible", "separate_turn_on_commands": "separate_turn_on_commands, for each attribute (color, brightness, etc.) in 'light.turn_on', required for some lights.", "sleep_brightness": "sleep_brightness, in %", + "sleep_rgb_or_color_temp": "sleep_rgb_or_color_temp, use 'rgb' or 'color_temp'", "sleep_color_temp": "sleep_color_temp, in Kelvin", + "sleep_rgb_color": "sleep_rgb_color, in RGB", "sunrise_offset": "sunrise_offset, in +/- seconds", "sunrise_time": "sunrise_time, in 'HH:MM:SS' format (if 'None', it uses the actual sunrise time at your location)", "sunset_offset": "sunset_offset, in +/- seconds",