Skip to content

Fix setup retries, unload cleanup and reauth form errors - #321

Merged
Sholofly merged 1 commit into
devfrom
fix/setup-and-unload-handling
Oct 30, 2026
Merged

Sholofly merged 1 commit into
devfrom
fix/setup-and-unload-handling

Conversation

@Sholofly

Copy link
Copy Markdown
Owner
  • Disconnect the API when the config entry unloads or fails to set up. Reloading used to leave the old MQTT connection running.
  • Raise ConfigEntryNotReady for a connection error during setup so Home Assistant retries, and drop the matching on error message text. A real authentication failure still starts reauthentication.
  • Catch the locked account error before the unauthorized error it derives from, so it can be reached.
  • Show invalid_auth, account_locked, cannot_connect and unknown on the reauth form. The step raised these errors without catching them, so a wrong password ended in an unhandled exception.
  • Add tests for setup, unload, reload and the reauth flow.

- Disconnect the API when the config entry unloads or fails to set up.
  Reloading used to leave the old MQTT connection running.
- Raise ConfigEntryNotReady for a connection error during setup so Home
  Assistant retries, and drop the matching on error message text. A real
  authentication failure still starts reauthentication.
- Catch the locked account error before the unauthorized error it
  derives from, so it can be reached.
- Show invalid_auth, account_locked, cannot_connect and unknown on the
  reauth form. The step raised these errors without catching them, so a
  wrong password ended in an unhandled exception.
- Add tests for setup, unload, reload and the reauth flow.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Sholofly
Sholofly enabled auto-merge (squash) October 30, 2026 22:10
@Sholofly
Sholofly merged commit b581483 into dev Oct 30, 2026
2 checks passed
@Sholofly
Sholofly deleted the fix/setup-and-unload-handling branch October 30, 2026 22:13
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