adaptive-lighting/custom_components/adaptive_lighting/services.yaml
Leonhard Hesse aa84eda871
feat: add expand_light_groups option (#1462)
* feat: add expand_light_groups option

Some light group entities act as a proxy that must receive a single combined
`light.turn_on` call to function correctly — virtual mixers like
<https://github.com/mion00/color-temperature-light-mixer> for instance,
that blend a warm and a cold white channel into one entity. In such setups the
individual member entities only expose `ColorMode.BRIGHTNESS`, so sending
separate per-member commands bypasses the mixing logic.

Setting `expand_light_groups: false` keeps the group entity in `self.lights`
instead of expanding it to its members. Adaptation commands go to the group,
and the interceptor no longer skips group entities for that switch.

Default is `true` — no behaviour change for existing configurations.

* tests: regression test for expand_light_groups=False

_switches_with_lights was expanding the incoming entity_id globally,
causing the switch to never be found when expand_light_groups=False

* Resolve group targets consistently across adaptation paths

* Discard delayed group events after target changes

* Stabilize delayed group target regression test

---------

Co-authored-by: Bas Nijholt <bas@nijho.lt>
2026-09-06 21:13:35 +02:00

270 lines
9.5 KiB
YAML

# This file is auto-generated by .github/update-services.py.
apply:
description: Applies the current Adaptive Lighting settings to lights.
fields:
entity_id:
description: The `entity_id` of the switch with the settings to apply. 📝
selector:
entity:
integration: adaptive_lighting
domain: switch
multiple: false
lights:
description: A light (or list of lights) to apply the settings to. 💡
selector:
entity:
domain: light
multiple: true
transition:
description: Duration of transition when lights change, in seconds. 🕑
example: 10
selector:
text: null
adapt_brightness:
description: Whether to adapt the brightness of the light. 🌞
example: true
selector:
boolean: null
adapt_color:
description: Whether to adapt the color on supporting lights. 🌈
example: true
selector:
boolean: null
prefer_rgb_color:
description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈
example: false
selector:
boolean: null
turn_on_lights:
description: Whether to turn on lights that are currently off. 🔆
example: false
selector:
boolean: null
set_manual_control:
description: Mark whether a light is 'manually controlled'.
fields:
entity_id:
description: The `entity_id` of the switch in which to (un)mark the light as being `manually controlled`. 📝
selector:
entity:
integration: adaptive_lighting
domain: switch
multiple: false
lights:
description: entity_id(s) of lights, if not specified, all lights in the switch are selected. 💡
selector:
entity:
domain: light
multiple: true
manual_control:
description: Whether to add ("true") or remove ("false") all adapted attributes of the light from the "manual_control" list, or the name of an attribute for selective addition. 🔒
example: true
default: true
selector:
boolean: null
change_switch_settings:
description: Change any settings you'd like in the switch. All options here are the same as in the config flow.
target:
entity:
integration: adaptive_lighting
domain: switch
fields:
use_defaults:
description: 'Sets the default values not specified in this service call. Options: "current" (default, retains current values), "factory" (resets to documented defaults), or "configuration" (reverts to switch config defaults). ⚙️'
example: current
required: false
default: current
selector:
select:
options:
- current
- configuration
- factory
include_config_in_attributes:
description: Show all options as attributes on the switch in Home Assistant when set to `true`. 📝
required: false
selector:
boolean: null
turn_on_lights:
description: Whether to turn on lights that are currently off. 🔆
example: false
required: false
selector:
boolean: null
initial_transition:
description: Duration of the first transition when lights turn from `off` to `on` in seconds. ⏲️
example: 1
required: false
selector:
text: null
sleep_transition:
description: Duration of transition when "sleep mode" is toggled in seconds. 😴
example: 1
required: false
selector:
text: null
max_brightness:
description: Maximum brightness percentage. 💡
required: false
example: 100
selector:
text: null
max_color_temp:
description: Coldest color temperature in Kelvin. ❄️
required: false
example: 5500
selector:
text: null
min_brightness:
description: Minimum brightness percentage. 💡
required: false
example: 1
selector:
text: null
min_color_temp:
description: Warmest color temperature in Kelvin. 🔥
required: false
example: 2000
selector:
text: null
only_once:
description: Adapt lights only when they are turned on (`true`) or keep adapting them (`false`). 🔄
example: false
required: false
selector:
boolean: null
prefer_rgb_color:
description: Whether to prefer RGB color adjustment over light color temperature when possible. 🌈
required: false
example: false
selector:
boolean: null
expand_light_groups:
description: Expand light groups to their members (`true`, default). Set `false` to send commands to the group and track manual control for the group. Explicit member targets in services stay individual targets.
required: false
example: true
selector:
boolean: null
separate_turn_on_commands:
description: Use separate `light.turn_on` calls for color and brightness, needed for some light types. 🔀
required: false
example: false
selector:
boolean: null
send_split_delay:
description: Delay (ms) between `separate_turn_on_commands` for lights that don't support simultaneous brightness and color setting. ⏲️
required: false
example: 0
selector:
boolean: null
sleep_brightness:
description: Brightness percentage of lights in sleep mode. 😴
required: false
example: 1
selector:
text: null
sleep_rgb_or_color_temp:
description: Use either `"rgb_color"` or `"color_temp"` in sleep mode. 🌙
required: false
example: color_temp
selector:
select:
options:
- rgb_color
- color_temp
sleep_rgb_color:
description: RGB color in sleep mode (used when `sleep_rgb_or_color_temp` is "rgb_color"). 🌈
required: false
selector:
color_rgb: null
sleep_color_temp:
description: Color temperature in sleep mode (used when `sleep_rgb_or_color_temp` is `color_temp`) in Kelvin. 😴
required: false
example: 1000
selector:
text: null
sunrise_offset:
description: Adjust sunrise time with a positive or negative offset in seconds. ⏰
required: false
example: 0
selector:
number:
min: -86400
max: 86300
sunrise_time:
description: Set a fixed time (HH:MM:SS) for sunrise. 🌅
required: false
example: ''
selector:
time: null
sunset_offset:
description: Adjust sunset time with a positive or negative offset in seconds. ⏰
required: false
example: ''
selector:
number:
min: -86400
max: 86300
sunset_time:
description: Set a fixed time (HH:MM:SS) for sunset. 🌇
example: ''
required: false
selector:
time: null
max_sunrise_time:
description: Set the latest virtual sunrise time (HH:MM:SS), allowing for earlier sunrises. 🌅
example: ''
required: false
selector:
time: null
min_sunset_time:
description: Set the earliest virtual sunset time (HH:MM:SS), allowing for later sunsets. 🌇
example: ''
required: false
selector:
time: null
take_over_control:
description: Pause adaptation of individual lights and hand over (manual) control to other sources that issue `light.turn_on` calls for lights that are on. 🔒
required: false
example: true
selector:
boolean: null
take_over_control_mode:
description: The adaptation pausing mode when other sources change brightness and/or color of lights. `pause_all` always pauses both brightness and color adaptation. `pause_changed` pauses the adaptation of only the changed attributes and continues adapting unchanged attributes, e.g., continues color adaptation when only brightness was changed.
required: false
example: pause_changed
selector:
select:
options:
- pause_all
- pause_changed
detect_non_ha_changes:
description: 'Detects and halts adaptations for non-`light.turn_on` state changes. Needs `take_over_control` enabled. 🕵️ Caution: ⚠️ Some lights might falsely indicate an ''on'' state, which could result in lights turning on unexpectedly. Note that this calls `homeassistant.update_entity` every `interval`! Disable this feature if you encounter such issues.'
required: false
example: false
selector:
boolean: null
manual_control_on_external_turn_on:
description: Treat turn-ons without a matching Home Assistant `light.turn_on` context as manual control. Normal manual-control resets apply. Still allows `detect_non_ha_changes` for already-on lights. Needs `take_over_control` enabled. 🕵️
required: false
example: false
selector:
boolean: null
transition:
description: Duration of transition when lights change, in seconds. 🕑
required: false
example: 45
selector:
text: null
adapt_delay:
description: Wait time (seconds) between light turn on and Adaptive Lighting applying changes. Might help to avoid flickering. ⏲️
required: false
example: 0
selector:
text: null
autoreset_control_seconds:
description: Automatically reset the manual control after a number of seconds. Set to 0 to disable. ⏲️
required: false
example: 0
selector:
text: null