Remove name selection#169446
Conversation
f68c715 to
03d93ad
Compare
There was a problem hiding this comment.
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
namefield from the LOQED config flow and add apick_lockstep when multiple locks are found. - Update config entry title to use the lock name returned by the API.
- Bump
loqedAPIdependency to2.1.11and 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. |
…it is not present in zeroconf flow
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
3c5d3aa to
9d3573d
Compare
There was a problem hiding this comment.
Please comment the why, not the what. :)
There was a problem hiding this comment.
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? :)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I only spot the self._api_token in the zeroconf flow and step_pick_lock. Am I overlooking it? Can you link it?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ah, there's the caveat. Thanks for checking @mikewoudenberg, so it has a good usecase this way - all good. :)
There was a problem hiding this comment.
These patching is reused in multiple tests. Why not add this to conftest, so it be loaded in as a pytest fixture? :)
Proposed change
Remove name field from loqed config flow by letting the user select the lock from a list.
Type of change
Additional information
loqedconfig flow #168935Checklist
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: