Skip to content

Conversation

@basnijholt
Copy link
Owner

Summary

Users have complained about the overwhelming number of options (28+) in the configuration UI. This PR splits the options flow into two steps to improve usability.

Basic Settings (9 options)

  • lights - Light entities to control
  • min_brightness / max_brightness - Brightness range
  • min_color_temp / max_color_temp - Color temperature range
  • sleep_brightness / sleep_color_temp - Sleep mode settings
  • transition / interval - Timing settings

Advanced Settings (20+ options)

All other options including sunrise/sunset times, offsets, brightness modes, take_over_control, detect_non_ha_changes, etc.

Flow

  1. User configures basic options
  2. Menu appears with choices: "Configure advanced options" or "Save and finish"
  3. If advanced chosen → show advanced options form → save all
  4. If finish chosen → save with just basic options (advanced options use defaults)

Changes

  • Add BASIC_OPTIONS constant to const.py
  • Refactor OptionsFlowHandler with multi-step flow:
    • async_step_init - Basic options + menu
    • async_step_advanced - Advanced options
    • async_step_finish - Save without advanced
  • Update strings.json with menu_options and advanced step
  • Update all 34 translation files with proper translations
  • Update tests for multi-step flow

Weblate Note

After merging, run "Rescan all translation files in the Weblate repository" to pick up the new structure. Existing translations are preserved in the files - they've just been reorganized from init.data to advanced.data.

Test plan

  • All 134 tests pass
  • Manual testing of options flow UI
  • Verify translations display correctly

basnijholt and others added 4 commits November 27, 2025 13:45
Users have complained about the overwhelming number of options (28+)
in the configuration UI. This change splits the options into two steps:

**Basic Settings (9 options):**
- lights, min/max brightness, min/max color temp
- sleep brightness, sleep color temp, transition, interval

**Advanced Settings (20+ options):**
- All other options (sunrise/sunset times, offsets, brightness modes,
  take_over_control, detect_non_ha_changes, etc.)

The flow now works as:
1. User configures basic options
2. Menu appears: "Configure advanced options" or "Save and finish"
3. If advanced chosen, show advanced options form
4. Save combined options

Changes:
- Add BASIC_OPTIONS constant to const.py
- Refactor OptionsFlowHandler with async_step_init, async_step_advanced,
  async_step_finish methods
- Update strings.json with menu_options and advanced step
- Update all 34 translation files with translated menu/titles
- Update tests for multi-step flow

Note for Weblate: After merging, run "Rescan all translation files"
to pick up the new structure. Existing translations are preserved.
The _build_options_schema method was calling _get_lights_schema internally,
causing it to be called multiple times redundantly. This refactoring:

- Renames _get_lights_schema to _prepare_lights_schema for clarity
- Changes _build_options_schema to accept to_replace as a parameter
- Updates all callers to prepare lights schema first and pass it
- Fixes async_step_advanced which was broken due to missing parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant