adaptive-lighting/custom_components/adaptive_lighting
Casey 249d18689e Fix OptionsFlowWithReload incompatibility with add_update_listener
Production HA caught this on the first save attempt: HA rejects
`config_entry.add_update_listener()` when the integration also uses
`OptionsFlowWithReload`, raising:

    ValueError: Config entry update listeners should not be used with
    OptionsFlowWithReload

The listener was a vestigial bit of the pre-redesign reload plumbing
that should have been deleted alongside the manual reload path (design
decision D6). Removed:

- `config_entry.add_update_listener(async_update_options)` registration
  in `async_setup_entry`
- `async_update_options` helper (only existed to call `async_reload`)
- `UNDO_UPDATE_LISTENER` tracking in `async_unload_entry`
- The `UNDO_UPDATE_LISTENER` import (still defined in const.py for any
  external code that imports it; pruning that is a separate cleanup)

Updated `tests/test_init.py::test_successful_setup_on_current_version`
to assert `entry.entry_id in hass.data[DOMAIN]` instead of the listener
key. All 94 tests still pass locally.

This is the first real-HA-only bug we've shipped — props to the
production deploy for catching it before merge.
2026-05-16 16:23:23 +02:00
..
translations Groups 8 + 9: strings, services.yaml, README, CHANGELOG (37/53) 2026-05-16 14:59:09 +02:00
__init__.py Fix OptionsFlowWithReload incompatibility with add_update_listener 2026-05-16 16:23:23 +02:00
_docs_helpers.py Implement cdit-config-redesign groups 1-6 (30/53 tasks) 2026-05-16 14:27:39 +02:00
adaptation_utils.py Individual manual control of brightness and color (#1356) 2025-12-22 22:55:16 -08:00
color_and_brightness.py Implement cdit-config-redesign groups 1-6 (30/53 tasks) 2026-05-16 14:27:39 +02:00
config_flow.py Implement cdit-config-redesign groups 1-6 (30/53 tasks) 2026-05-16 14:27:39 +02:00
const.py Implement cdit-config-redesign groups 1-6 (30/53 tasks) 2026-05-16 14:27:39 +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 Implement cdit-config-redesign groups 1-6 (30/53 tasks) 2026-05-16 14:27:39 +02:00
services.yaml Groups 8 + 9: strings, services.yaml, README, CHANGELOG (37/53) 2026-05-16 14:59:09 +02:00
strings.json Groups 8 + 9: strings, services.yaml, README, CHANGELOG (37/53) 2026-05-16 14:59:09 +02:00
switch.py Auto-fix unused imports across tests + switch.py (ruff --fix) 2026-05-16 15:12:19 +02:00