Skip to content

Commit a387b6c

Browse files
Florian HornerFlorian Horner
authored andcommitted
Merge PR basnijholt#1455: Allow sleep_brightness=0 (resolved: keep our string rewrites)
2 parents af59096 + 25df029 commit a387b6c

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The YAML and frontend configuration methods support all of the options listed be
120120
| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 |
121121
| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 |
122122
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` |
123-
| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 |
123+
| `sleep_brightness` | Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴 | `1` | `int` 0-100 |
124124
| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` |
125125
| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 |
126126
| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |

custom_components/adaptive_lighting/const.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ class TakeOverControlMode(Enum):
116116
)
117117

118118
CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS = "sleep_brightness", 1
119-
DOCS[CONF_SLEEP_BRIGHTNESS] = "Brightness percentage of lights in sleep mode. 😴"
119+
DOCS[CONF_SLEEP_BRIGHTNESS] = (
120+
"Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴"
121+
)
120122

121123
CONF_SLEEP_COLOR_TEMP, DEFAULT_SLEEP_COLOR_TEMP = "sleep_color_temp", 1000
122124
DOCS[CONF_SLEEP_COLOR_TEMP] = (
@@ -330,7 +332,7 @@ def int_between(min_int: int, max_int: int) -> vol.All:
330332
(CONF_MIN_COLOR_TEMP, DEFAULT_MIN_COLOR_TEMP, int_between(1000, 10000)),
331333
(CONF_MAX_COLOR_TEMP, DEFAULT_MAX_COLOR_TEMP, int_between(1000, 10000)),
332334
(CONF_PREFER_RGB_COLOR, DEFAULT_PREFER_RGB_COLOR, bool),
333-
(CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS, int_between(1, 100)),
335+
(CONF_SLEEP_BRIGHTNESS, DEFAULT_SLEEP_BRIGHTNESS, int_between(0, 100)),
334336
(
335337
CONF_SLEEP_RGB_OR_COLOR_TEMP,
336338
DEFAULT_SLEEP_RGB_OR_COLOR_TEMP,

custom_components/adaptive_lighting/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ change_switch_settings:
154154
selector:
155155
boolean: null
156156
sleep_brightness:
157-
description: Brightness percentage of lights in sleep mode. 😴
157+
description: Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴
158158
required: false
159159
example: 1
160160
selector:

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ All configuration options are listed below with their default values. These opti
4949
| `min_color_temp` | Warmest color temperature in Kelvin. 🔥 | `2000` | `int` 1000-10000 |
5050
| `max_color_temp` | Coldest color temperature in Kelvin. ❄️ | `5500` | `int` 1000-10000 |
5151
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | `False` | `bool` |
52-
| `sleep_brightness` | Brightness percentage of lights in sleep mode. 😴 | `1` | `int` 1-100 |
52+
| `sleep_brightness` | Brightness percentage of lights in sleep mode. Set to 0 to prevent lights from turning on. 😴 | `1` | `int` 0-100 |
5353
| `sleep_rgb_or_color_temp` | Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙 | `color_temp` | one of `['color_temp', 'rgb_color']` |
5454
| `sleep_color_temp` | Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴 | `1000` | `int` 1000-10000 |
5555
| `sleep_rgb_color` | RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈 | `[255, 56, 0]` | RGB color |

0 commit comments

Comments
 (0)