From 8e5041513629a8d2ebfe235ecd262bc23bf49cda Mon Sep 17 00:00:00 2001 From: jaynis Date: Thu, 26 Mar 2026 21:34:25 +0100 Subject: [PATCH] allowed for sleep_brightness to be set to 0 Signed-off-by: jaynis --- README.md | 2 +- custom_components/adaptive_lighting/const.py | 4 ++-- custom_components/adaptive_lighting/services.yaml | 2 +- custom_components/adaptive_lighting/strings.json | 4 ++-- custom_components/adaptive_lighting/translations/en.json | 4 ++-- docs/configuration.md | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3a26df24..162944d3 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ The YAML and frontend configuration methods support all of the options listed be | `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 | | `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 | | `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` | -| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 | +| `sleep_brightness` | Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴 | `1` | `int` 0-100 | | `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` | | `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 | | `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color | diff --git a/custom_components/adaptive_lighting/const.py b/custom_components/adaptive_lighting/const.py index 502318f0..244871d4 100644 --- a/custom_components/adaptive_lighting/const.py +++ b/custom_components/adaptive_lighting/const.py @@ -116,7 +116,7 @@ DOCS[CONF_SEPARATE_TURN_ON_COMMANDS] = ( ) CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS = "sleep_brightness", 1 -DOCS[CONF_SLEEP_BRIGHTNESS] = "Brightness percentage of lights in sleep mode. 😴" +DOCS[CONF_SLEEP_BRIGHTNESS] = "Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴" CONF_SLEEP_COLOR_TEMP, DEFAULT_SLEEP_COLOR_TEMP = "sleep_color_temp", 1000 DOCS[CONF_SLEEP_COLOR_TEMP] = ( @@ -330,7 +330,7 @@ VALIDATION_TUPLES: list[tuple[str, Any, Any]] = [ (CONF_MIN_COLOR_TEMP, DEFAULT_MIN_COLOR_TEMP, int_between(1000, 10000)), (CONF_MAX_COLOR_TEMP, DEFAULT_MAX_COLOR_TEMP, int_between(1000, 10000)), (CONF_PREFER_RGB_COLOR, DEFAULT_PREFER_RGB_COLOR, bool), - (CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS, int_between(1, 100)), + (CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS, int_between(0, 100)), ( CONF_SLEEP_RGB_OR_COLOR_TEMP, DEFAULT_SLEEP_RGB_OR_COLOR_TEMP, diff --git a/custom_components/adaptive_lighting/services.yaml b/custom_components/adaptive_lighting/services.yaml index 09979bac..ac329eac 100644 --- a/custom_components/adaptive_lighting/services.yaml +++ b/custom_components/adaptive_lighting/services.yaml @@ -154,7 +154,7 @@ change_switch_settings: selector: boolean: null sleep_brightness: - description: Brightness percentage of lights in sleep mode. 😴 + description: Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴 required: false example: 1 selector: diff --git a/custom_components/adaptive_lighting/strings.json b/custom_components/adaptive_lighting/strings.json index 4b18ea06..83f0fc84 100644 --- a/custom_components/adaptive_lighting/strings.json +++ b/custom_components/adaptive_lighting/strings.json @@ -70,7 +70,7 @@ "interval": "Frequency to adapt the lights, in seconds. 🔄", "transition": "Duration of transition when lights change, in seconds. 🕑", "initial_transition": "Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️", - "sleep_brightness": "Brightness percentage of lights in sleep mode. 😴", + "sleep_brightness": "Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴", "sleep_rgb_or_color_temp": "Use either `\"rgb_color\"` or `\"color_temp\"` in sleep mode. 🌙", "sleep_color_temp": "Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴", "sleep_rgb_color": "RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is \"rgb_color\"). 🌈", @@ -212,7 +212,7 @@ "name": "send_split_delay" }, "sleep_brightness": { - "description": "Brightness percentage of lights in sleep mode. 😴", + "description": "Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴", "name": "sleep_brightness" }, "sleep_rgb_or_color_temp": { diff --git a/custom_components/adaptive_lighting/translations/en.json b/custom_components/adaptive_lighting/translations/en.json index e39898fd..e16ac1c3 100644 --- a/custom_components/adaptive_lighting/translations/en.json +++ b/custom_components/adaptive_lighting/translations/en.json @@ -71,7 +71,7 @@ "interval": "Frequency to adapt the lights, in seconds. 🔄", "transition": "Duration of transition when lights change, in seconds. 🕑", "initial_transition": "Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️", - "sleep_brightness": "Brightness percentage of lights in sleep mode. 😴", + "sleep_brightness": "Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴", "sleep_rgb_or_color_temp": "Use either `\"rgb_color\"` or `\"color_temp\"` in sleep mode. 🌙", "sleep_color_temp": "Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴", "sleep_rgb_color": "RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is \"rgb_color\"). 🌈", @@ -213,7 +213,7 @@ "name": "send_split_delay" }, "sleep_brightness": { - "description": "Brightness percentage of lights in sleep mode. 😴", + "description": "Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴", "name": "sleep_brightness" }, "sleep_rgb_or_color_temp": { diff --git a/docs/configuration.md b/docs/configuration.md index 21c7028e..4e9819f1 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -49,7 +49,7 @@ All configuration options are listed below with their default values. These opti | `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 | | `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 | | `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` | -| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 | +| `sleep_brightness` | Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴 | `1` | `int` 0-100 | | `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` | | `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 | | `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |