adaptive-lighting/custom_components/adaptive_lighting/services.yaml
Adam DeMuri 623dd65aef
Register service actions in async_setup for Bronze tier compliance (#1403)
* Register service actions in async_setup for Bronze tier compliance

- Move 'apply' and 'set_manual_control' service registration from async_setup_entry to async_setup.
- Move service handlers to module-level functions in switch.py.
- Update apply_service_schema to support dynamic defaults for transition duration.
- Clean up related unused imports and fix Python 3.10 syntax compatibility.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Clean up and add tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix lint errors

* Automated update of generated docs

* Re-add types

* Make transition not required again

* fix: validate global service targets

* fix: document optional apply transition

* fix: derive service docs from schema markers

* docs: clarify service target options

* fix: preserve entity service target handling

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2026-09-06 13:04:18 +02:00

258 lines
8.8 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
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
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