Skip to content

Remove name selection#169446

Draft
mikewoudenberg wants to merge 9 commits intohome-assistant:devfrom
mikewoudenberg:remove-name-selection
Draft

Remove name selection#169446
mikewoudenberg wants to merge 9 commits intohome-assistant:devfrom
mikewoudenberg:remove-name-selection

Conversation

@mikewoudenberg
Copy link
Copy Markdown
Contributor

Proposed change

Remove name field from loqed config flow by letting the user select the lock from a list.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@mikewoudenberg mikewoudenberg force-pushed the remove-name-selection branch from f68c715 to 03d93ad Compare April 29, 2026 11:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the loqed integration config flow to stop asking the user to enter a lock name, instead selecting the lock from the user’s LOQED account.

Changes:

  • Remove the name field from the LOQED config flow and add a pick_lock step when multiple locks are found.
  • Update config entry title to use the lock name returned by the API.
  • Bump loqedAPI dependency to 2.1.11 and adjust tests/strings accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
homeassistant/components/loqed/config_flow.py Removes name input, adds lock picker step, and sets entry title from selected lock.
homeassistant/components/loqed/strings.json Updates config flow strings: removes name prompt, adds lock selection step + new errors.
tests/components/loqed/test_config_flow.py Updates tests for new flow behavior (title changes, picker step, new data expectations).
homeassistant/components/loqed/manifest.json Bumps loqedAPI requirement to 2.1.11.
requirements_all.txt Bumps loqedAPI to 2.1.11.
requirements_test_all.txt Bumps loqedAPI to 2.1.11.

Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Copilot AI review requested due to automatic review settings April 29, 2026 12:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread tests/components/loqed/test_config_flow.py Outdated
Comment thread tests/components/loqed/test_config_flow.py Outdated
Comment thread tests/components/loqed/test_config_flow.py Outdated
Comment thread tests/components/loqed/test_config_flow.py
@home-assistant home-assistant Bot marked this pull request as draft April 30, 2026 10:12
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

Copilot AI review requested due to automatic review settings April 30, 2026 18:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread homeassistant/components/loqed/config_flow.py
Co-authored-by: Copilot <copilot@github.com>
@mikewoudenberg mikewoudenberg marked this pull request as ready for review April 30, 2026 19:10
Copilot AI review requested due to automatic review settings April 30, 2026 19:10
@home-assistant home-assistant Bot requested a review from erwindouna April 30, 2026 19:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread tests/components/loqed/test_config_flow.py
Copilot AI review requested due to automatic review settings April 30, 2026 19:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread homeassistant/components/loqed/config_flow.py
Comment thread tests/components/loqed/test_config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread homeassistant/components/loqed/config_flow.py Outdated
Comment thread tests/components/loqed/test_config_flow.py
@home-assistant home-assistant Bot marked this pull request as draft April 30, 2026 21:23
@mikewoudenberg mikewoudenberg force-pushed the remove-name-selection branch from 3c5d3aa to 9d3573d Compare May 6, 2026 11:06
Copilot AI review requested due to automatic review settings May 6, 2026 12:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@mikewoudenberg mikewoudenberg marked this pull request as ready for review May 6, 2026 13:32
@home-assistant home-assistant Bot requested a review from erwindouna May 6, 2026 13:32
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Please comment the why, not the what. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use this to transfer over this to async_step_pick_lock? Why not pass the user_input at this line.
If I understood the flow correctly, this would reduce a private variable you can reduce. What do you think? :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also used in the validate_input function to save a second call to the cloud api, any way I can improve it with that constraint?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only spot the self._api_token in the zeroconf flow and step_pick_lock. Am I overlooking it? Can you link it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, was looking at the wrong variable. I attempted your suggestion, but I ended up needing to store the user Input in the configflowcontext (becuase the step gets called again after the user submits the form, and not having it in context would result in the validate input step failing ) resulting in more complexity than simply storing it in an instance variable.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, there's the caveat. Thanks for checking @mikewoudenberg, so it has a good usecase this way - all good. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These patching is reused in multiple tests. Why not add this to conftest, so it be loaded in as a pytest fixture? :)

@home-assistant home-assistant Bot marked this pull request as draft May 6, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove name field from loqed config flow

3 participants