adaptive-lighting/custom_components/adaptive_lighting
Alistair Galbraith 9e29a21197
Add manual_control_on_external_turn_on option (#1490)
* feat: add `adapt_only_on_ha_turn_on` to skip adapting externally turned-on lights

When a light turns on from `off` via a source outside Home Assistant — a
physical wall switch or a hub/manufacturer scene (e.g. Lutron) — and
`detect_non_ha_changes` is enabled, Adaptive Lighting adapts the light on the
resulting `off` → `on` event, overriding the brightness/color the external
source just set. Disabling `detect_non_ha_changes` avoids this but also stops
detection of manual changes to already-on lights; the two behaviors were
coupled to a single flag.

Add `adapt_only_on_ha_turn_on` (default `false`, requires `take_over_control`).
When enabled, an `off` → `on` transition with no matching HA `light.turn_on`
context is marked `manual_control` and left untouched, independent of
`detect_non_ha_changes`, decoupling the two behaviors.

The off→on guard reduces to the previous expression when the option is `false`,
so existing configurations are unaffected. Includes a parametrized regression
test, docs, and regenerated strings/services/README via
scripts/update-generated-content.

Refs #435

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Shorten generated turn-on option description

* Document shared turn-on policy limitations

* Name external turn-on policy after manual-control behavior

* Clarify settings needed to adapt unmatched turn-ons

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Bas Nijholt <bas@nijho.lt>
2026-09-06 21:02:30 +02:00
..
translations Add manual_control_on_external_turn_on option (#1490) 2026-09-06 21:02:30 +02:00
__init__.py Register service actions in async_setup for Bronze tier compliance (#1403) 2026-09-06 13:04:18 +02:00
_docs_helpers.py Register service actions in async_setup for Bronze tier compliance (#1403) 2026-09-06 13:04:18 +02:00
adaptation_utils.py Fix missing follow-up commands during multi-light interception (#1560) 2026-09-06 14:03:08 +02:00
color_and_brightness.py fix: keep adapting during polar night and midnight sun (#1489) 2026-09-06 00:23:21 -07:00
config_flow.py Implement collapsible sections for options flow (#1313) 2026-09-06 17:18:42 +02:00
const.py Add manual_control_on_external_turn_on option (#1490) 2026-09-06 21:02:30 +02:00
diagnostics.py Add on-demand Home Assistant diagnostics (#1575) 2026-09-06 19:11:55 +02:00
docs_gen.py Migrate to markdown-code-runner's built-in include_section() (#1417) 2026-01-26 09:01:50 +01:00
hass_utils.py Friendly names (#1258) 2025-11-27 12:01:05 -08:00
helpers.py Friendly names (#1258) 2025-11-27 12:01:05 -08:00
manifest.json Update manifest.json to v1.31.0 (#1486) 2026-07-07 09:38:26 -07:00
services.yaml Add manual_control_on_external_turn_on option (#1490) 2026-09-06 21:02:30 +02:00
strings.json Add manual_control_on_external_turn_on option (#1490) 2026-09-06 21:02:30 +02:00
switch.py Add manual_control_on_external_turn_on option (#1490) 2026-09-06 21:02:30 +02:00