Skip to content

fix(config-flow): make pairing menu actually render (v1.1.2)#4

Merged
hrabbach merged 2 commits into
mainfrom
pr/fix-pairing-menu-step-exists
Jun 25, 2026
Merged

fix(config-flow): make pairing menu actually render (v1.1.2)#4
hrabbach merged 2 commits into
mainfrom
pr/fix-pairing-menu-step-exists

Conversation

@hrabbach

Copy link
Copy Markdown
Owner

Summary

v1.1.1 was broken and must be superseded. The fix made async_step_user return a menu with step_id="menu", but async_step_menu had been removed. HA validates that a shown step_id resolves to an async_step_<id> handler and raises UnknownStep otherwise — so opening "Add device" would error instead of showing the menu. The unit test called async_step_user directly and never exercised HA''s step-existence check, so it passed.

This was caught by a new flow-seam test driving the real hass.config_entries.subentries.async_init(...) — exactly the gap identified in the v1.1.0 post-mortem.

Changes

  • async_step_user now delegates to async_step_menu (restored), which serves async_show_menu(step_id="menu", ...). Both methods exist → satisfies HA''s subentry-flow contract.
  • New test_subentry_flow_entry_step_is_menu: drives subentries.async_init and asserts the menu is the first step. Direct handler.async_step_x(None) calls cannot catch step-existence/entry-point bugs; this can.

Verification

  • ruff ✅ · mypy ✅ · full pytest 165 passed (WSL), including the new seam test which fails against the v1.1.1 code.

Release

Patch bump manifest.json1.1.2. Tag v1.1.2 after merge.

🤖 Generated with Claude Code

hrabbach and others added 2 commits June 26, 2026 00:48
…y renders

v1.1.1 regressed: async_step_user returned a menu with step_id="menu" but
async_step_menu had been removed. HA validates that a shown step_id resolves to
an async_step_<id> handler and raises UnknownStep otherwise, so opening
"Add device" errored instead of showing the menu. The unit test that called
async_step_user directly never exercised HA's step-existence check, so it passed.

- async_step_user now delegates to async_step_menu (restored), which serves
  async_show_menu(step_id="menu", ...). Both methods exist, satisfying HA's
  subentry-flow contract.
- add test_subentry_flow_entry_step_is_menu: drives the real seam
  hass.config_entries.subentries.async_init(...) and asserts the menu is the
  first step — this is the test that catches entry-point/step-existence bugs
  that direct handler-method calls cannot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwPMgtiypLgJ5nkR3mUGfL
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QwPMgtiypLgJ5nkR3mUGfL
@hrabbach hrabbach merged commit 7870849 into main Jun 25, 2026
@hrabbach hrabbach deleted the pr/fix-pairing-menu-step-exists branch June 25, 2026 22:49
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