Skip to content

feat(config_flow): per-provider reconfigure flow (Phase 8 PR-6)#91

Merged
Artic0din merged 2 commits into
feat/reauth-flowsfrom
feat/reconfigure-flow
May 22, 2026
Merged

feat(config_flow): per-provider reconfigure flow (Phase 8 PR-6)#91
Artic0din merged 2 commits into
feat/reauth-flowsfrom
feat/reconfigure-flow

Conversation

@Artic0din
Copy link
Copy Markdown
Owner

Summary

PR-6 — HA 2024.10+ "Reconfigure" button now opens a per-provider settings page that lets users adjust supplemental fields (fees, supply charges, buy/sell guard rails) without losing accumulated cost history.

  • async_step_reconfigure(entry_data) dispatcher routes by coordinator._current_plan_provider.id to one of four sub-steps. Mirrors the PR-5 reauth dispatcher pattern.
  • 4 sub-steps: reconfigure_amber (fees), reconfigure_localvolts (supply + ceiling + floor), reconfigure_dwt_oe (supply), reconfigure_dwt_aemo (supply). CDR-plan entries get reconfigure_unsupported abort.
  • Each save calls async_update_reload_and_abort(entry, options={...})entry.data, entry.unique_id, and runtime_data accumulators are unchanged.
  • Narrow scope per D-P8-2: region swap (DWT) and site_id swap (Amber) NOT exposed — would invalidate the region-derived unique_id from Phase 7 PR-2b. Future major version with unique_id redesign can expose full reconfigure.
  • 15 new tests (source-level dispatcher + sub-step contract + strings parity + history-preservation guard).
  • 925 total pass.

Stacked on PR #90.

Test plan

  • pytest -q → 925 passed (910 + 15)
  • ruff check → clean
  • strings byte-identical
  • UAT: click Reconfigure on each entry type → confirm right sub-step opens; save adjusts the right field; sensors continue without history reset

Decisions: D-P8-2.

PR-6 — HA 2024.10+ "Reconfigure" button now opens a per-provider
settings page. Each sub-step edits supplemental fields without
losing accumulated cost history.

- async_step_reconfigure(entry_data) dispatcher mirrors the PR-5
  reauth pattern. Reads coordinator._current_plan_provider.id and
  routes to one of four sub-steps: reconfigure_amber (network +
  subscription fees), reconfigure_localvolts (daily supply + buy
  ceiling + sell floor), reconfigure_dwt_oe (daily supply only),
  reconfigure_dwt_aemo (daily supply only).
- Unsupported entry types (CDR-plan entries) abort cleanly with
  reason=reconfigure_unsupported.
- Each sub-step calls async_update_reload_and_abort with an updated
  options dict — entry.data, entry.unique_id, and runtime_data
  accumulators (daily_cost_history, _saving_month_aud) are unchanged.
- Narrow scope per D-P8-2: region swap (DWT) and site_id swap
  (Amber) are NOT exposed — they would invalidate the entry's
  unique_id which is region-derived from Phase 7 PR-2b. Future
  major version with unique_id redesign can expose full reconfigure.
- strings + translations: 4 new step descriptions + 2 abort reasons.
- 15 new tests; 925 total pass.

Decisions: DECISIONS.md > D-P8-2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Artic0din Artic0din merged commit 73a3638 into feat/reauth-flows May 22, 2026
2 of 4 checks passed
@Artic0din Artic0din deleted the feat/reconfigure-flow branch May 22, 2026 05:39
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