Repository navigation
Use protocol default port and keep form input in Axis config flow - #195402
genestealer wants to merge 4 commits into
Conversation
|
👋 Hi! Thanks for contributing to Home Assistant. This is your PR dashboard which flags anything you need to address before your PR can be reviewed. Once everything is green, you can press the 'Ready for review' button at the bottom of the page to notify reviewers to take a look. More information about this dashboardThis dashboard automatically updates on every change to this PR and reevaluates the rules as you go. Until everything has been addressed, the bot will keep the PR in draft. Skip a check that doesn't applyIf you think a check doesn't apply to your PR (or the rule is bugged), comment Bot commandsReply with
Checks✨ Everything's in order! 5 checks passed (6 skipped)
|
|
Hey there @Kane610, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsReply with
|
There was a problem hiding this comment.
🟡 Changes recommended
An omitted port retains the previous custom-port suggestion after a connection or authentication error, causing subsequent submissions to use it instead of the protocol default.
1 open issue
What changed in this PR
This PR improves Home Assistant’s Axis configuration flow by selecting default ports based on the protocol and preserving form input after connection or authentication errors.
Changes:
- Make the port optional, using 80 for HTTP or 443 for HTTPS while preserving explicit ports.
- Restore submitted values after errors and prefill custom ports during reconfiguration.
- Add port guidance and tests for default ports and form retries.
| File | Description |
|---|---|
tests/components/axis/test_config_flow.py |
Tests protocol defaults, custom ports, and input preservation after errors. |
homeassistant/components/axis/strings.json |
Explains the behavior when the port is left empty. |
homeassistant/components/axis/config_flow.py |
Resolves default ports and retains submitted form values. |
Review effort: Balanced (adaptive)

Proposed change
Fixes two problems with the Axis setup, reauthentication and reconfiguration form:
Existing config entries are not changed; the stored port is always a number.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: