♻️ Tidy config flow: drop unused hass, lambda, dedupe error mapping #51

Merged
mat merged 1 commit from refactor/config-flow-tidy into main 2026-07-10 18:15:56 +00:00
Owner

Pure, behavior-preserving refactor of config_flow.py:

  • drop the unused hass parameter from validate_input (+ its now-unused HomeAssistant import);
  • drop the needless lambda in asyncio.to_thread;
  • extract the duplicated try/except→errors mapping from both flow steps into a shared _validate helper, with a log_context kwarg that preserves the reauth-specific log message.

Independent of the other PRs.

  • 32/32 tests pass, ruff clean.
Pure, behavior-preserving refactor of `config_flow.py`: - drop the unused `hass` parameter from `validate_input` (+ its now-unused `HomeAssistant` import); - drop the needless lambda in `asyncio.to_thread`; - extract the duplicated try/except→`errors` mapping from both flow steps into a shared `_validate` helper, with a `log_context` kwarg that preserves the reauth-specific log message. Independent of the other PRs. - 32/32 tests pass, ruff clean.
♻️ Tidy config flow: drop unused hass, lambda, dedupe error mapping
All checks were successful
Validate / lint-ruff (push) Successful in 7s
Validate / test-pytest (push) Successful in 2m59s
Validate / type-check-mypy (push) Successful in 3m8s
Validate / lint-ruff (pull_request) Successful in 7s
Validate / test-pytest (pull_request) Successful in 3m20s
Validate / type-check-mypy (pull_request) Successful in 3m7s
6bf3f2212b
mat merged commit 19fed03729 into main 2026-07-10 18:15:56 +00:00
mat referenced this pull request from a commit 2026-07-13 13:03:58 +00:00
mat referenced this pull request from a commit 2026-10-12 13:25:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/homeassistant-comwatt!51
No description provided.