adaptive-lighting/custom_components/adaptive_lighting
Alistair Galbraith cb0e552ec5 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>
2026-07-11 17:19:26 -07:00
..
translations feat: add adapt_only_on_ha_turn_on to skip adapting externally turned-on lights 2026-07-11 17:19:26 -07:00
__init__.py Code cleanup (#1348) 2025-12-12 13:37:42 -08:00
_docs_helpers.py Individual manual control of brightness and color (#1356) 2025-12-22 22:55:16 -08:00
adaptation_utils.py Individual manual control of brightness and color (#1356) 2025-12-22 22:55:16 -08:00
color_and_brightness.py fix: replace deprecated get_astral_location with get_astral_observer (#1482) 2026-07-01 23:00:35 -07:00
config_flow.py fix: restore hassfest and Home Assistant CI 2026-04-24 11:31:53 -07:00
const.py feat: add adapt_only_on_ha_turn_on to skip adapting externally turned-on lights 2026-07-11 17:19:26 -07: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 Individual manual control of brightness and color (#1356) 2025-12-22 22:55:16 -08:00
strings.json feat: add adapt_only_on_ha_turn_on to skip adapting externally turned-on lights 2026-07-11 17:19:26 -07:00
switch.py feat: add adapt_only_on_ha_turn_on to skip adapting externally turned-on lights 2026-07-11 17:19:26 -07:00