mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-11-03 17:07:45 +01:00
✨ Add time option to adaptive_lighting.apply
Apply the settings Adaptive Lighting would use at a given time of day (today) instead of now, e.g. to switch a room to its evening settings early. The adapted attributes are marked as manually controlled, like a manual change in Home Assistant, so the regular adaptation keeps its hands off until manual control is reset. They are marked before the adaptation, so a regular adaptation can't slip in between and overwrite the values. Sleep mode takes precedence, and the switch's own settings and attributes are left untouched. `prepare_adaptation_data` no longer writes the switch's settings: it did so only to have values to read when the switch was off, and now uses the settings it calculates itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
283fec08ae
commit
54a821cc4c
10 changed files with 267 additions and 8 deletions
|
|
@ -28,6 +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) |
|
||||
|
||||
<!-- OUTPUT:END -->
|
||||
|
||||
|
|
@ -54,6 +55,19 @@ data:
|
|||
adapt_color: true
|
||||
```
|
||||
|
||||
```yaml
|
||||
# Set the lights to this evening's 22:00 settings and hold them there
|
||||
service: adaptive_lighting.apply
|
||||
data:
|
||||
entity_id: switch.adaptive_lighting_living_room
|
||||
lights:
|
||||
- light.sofa
|
||||
- light.floor_lamp
|
||||
time: "22:00:00"
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
---
|
||||
|
||||
## adaptive_lighting.set_manual_control
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue