📝 Document the apply time as a string that must be quoted in YAML

Unquoted, `22:00:00` is loaded as the integer 79200 (YAML 1.1 base 60),
which fails validation with an unhelpful "Invalid time specified".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mathias Berglund 2026-09-24 21:17:09 +03:00
commit 92b096a287
3 changed files with 7 additions and 3 deletions

View file

@ -227,7 +227,7 @@ Provide a switch in `entity_id`, a list of `lights`, or both.
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
| `time` | Manually apply the settings for this time of day (HH:MM:SS) instead of now. 🕰️ | ❌ | time (HH:MM:SS) |
| `time` | Manually apply the settings for this time of day (HH:MM:SS) instead of now. 🕰️ | ❌ | `str` (HH:MM:SS) |
<!-- OUTPUT:END -->
@ -245,6 +245,8 @@ data:
time: "22:00:00"
```
Quote the time in YAML (`"22:00:00"`), since an unquoted `22:00:00` is read as a number.
#### `adaptive_lighting.set_manual_control`
`adaptive_lighting.set_manual_control` can mark (or unmark) whether a light is "manually controlled", meaning that when a light has `manual_control`, the light is not adapted.

View file

@ -45,7 +45,7 @@ def _type_to_str(type_: Any) -> str: # noqa: PLR0911
if type_ == cv.boolean:
return "bool"
if type_ == cv.time:
return "time (HH:MM:SS)"
return "`str` (HH:MM:SS)"
if isinstance(type_, vol.All):
return _format_voluptuous_instance(type_)
if isinstance(type_, vol.Any):

View file

@ -28,7 +28,7 @@ Provide a switch in `entity_id`, a list of `lights`, or both.
| `adapt_color` | Whether to adapt the color on supporting lights. 🌈 | ❌ | bool |
| `prefer_rgb_color` | Whether to prefer RGB color adjustment over light color temperature when possible. 🌈 | ❌ | bool |
| `turn_on_lights` | Whether to turn on lights that are currently off. 🔆 | ❌ | bool |
| `time` | Manually apply the settings for this time of day (HH:MM:SS) instead of now. 🕰️ | ❌ | time (HH:MM:SS) |
| `time` | Manually apply the settings for this time of day (HH:MM:SS) instead of now. 🕰️ | ❌ | `str` (HH:MM:SS) |
<!-- OUTPUT:END -->
@ -66,6 +66,8 @@ data:
time: "22:00:00"
```
Quote the time in YAML (`"22:00:00"`), since an unquoted `22:00:00` is read as a number.
With `time`, the lights get the values Adaptive Lighting would use at that time today. The adapted attributes are then marked as manually controlled, exactly as if you had changed them yourself: the regular adaptation leaves them alone until manual control is reset (for example by `autoreset_control_seconds` or `adaptive_lighting.set_manual_control`), and an `adaptive_lighting.manual_control` event is fired. When sleep mode is on, the sleep settings are applied instead, whatever the time. Unless `adapt_brightness` or `adapt_color` is given, only what the profile adapts (its Adapt Brightness and Adapt Color switches) is applied.
---