adaptive-lighting/custom_components/adaptive_lighting
Casey 7c565a5f5f Fix options-flow conditional reveal + empty lux-sensor save
Two config-flow bugs in the Ambient lux / Advanced sections:

- Conditional fields (target_lux, send_split_delay) only appeared on a
  fresh re-open of the dialog, never in the same session — violating the
  options-flow spec ('SHALL re-render ... in the same session'). Now, when
  a driver is enabled but its dependent field was hidden from the rendered
  schema, the form re-renders (carrying the user's edits) instead of saving.

- The options form could not be saved at all without selecting a lux
  sensor: vol.Optional(CONF_LUX_SENSOR, default='') fed '' into the
  illuminance EntitySelector, which rejects empty strings. Omit the
  default (vol.UNDEFINED) when no sensor is configured.

Extracted _has_pending_reveal() and _overlay_range_values() helpers to
keep async_step_init under the branch limit. Added 3 flow-level tests
exercising the real re-render path (prior tests only hit the schema
builder, which is how these slipped through). 141 tests pass.
2026-05-30 22:06:59 +02:00
..
translations Implement add-output-sensors: 36/41 tasks complete 2026-05-21 10:11:52 +02:00
__init__.py Implement add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +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 add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02:00
config_flow.py Fix options-flow conditional reveal + empty lux-sensor save 2026-05-30 22:06:59 +02:00
const.py Implement add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02: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 add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02:00
number.py Implement add-output-sensors: 36/41 tasks complete 2026-05-21 10:11:52 +02:00
sensor.py Implement add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02:00
services.yaml Groups 8 + 9: strings, services.yaml, README, CHANGELOG (37/53) 2026-05-16 14:59:09 +02:00
strings.json Implement add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02:00
switch.py Implement add-lux-target: reduce-only ambient lux gate 2026-05-25 16:11:52 +02:00