-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Add reconfiguration support for keenetic_ndms2 integration #142191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Hi @MartinHjelmare . Can you or some one else please do a review of this code? |
Why did you tag me? Please split the PR so the fix is in a separate PR from the new feature (reconfigure flow). |
63a8981
to
c502d5c
Compare
Hi @MartinHjelmare . I've tagged you because you were the last one involved in my PRs review :) I've separated the fix changes from the improvements. THis one now holds only the improvements. The fix was moved to #143475 |
c502d5c
to
0d8b94b
Compare
Introduce a reconfiguration flow to allow updates to existing configuration entries. This includes a new `async_step_reconfigure` method, updated config flow handling, and additional tests for reconfiguration logic.
0d8b94b
to
98cc346
Compare
async def async_step_reconfigure( | ||
self, user_input: dict[str, Any] | None = None | ||
) -> ConfigFlowResult: | ||
"""Handle reconfiguration.""" | ||
existing_entry_data = dict(self._get_reconfigure_entry().data) | ||
self._host = existing_entry_data[CONF_HOST] | ||
|
||
return await self.async_step_user(user_input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change username in the software?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean in the router software? Yes. You can create/remove users there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the intergation currently built? Does it connect to a single user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You configure the integration with any router user credentials, and it will connect to the router and do its job on behalf of that user.
Best you create a dedicated user on the router specifically for HA access. The integration in its current form needs only read access via telnet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Is there a way we can make sure we connect to the same router again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the integration does not store the identification information of the router. But it's possible to fetch the serial number of the device.
I see what you are thinking about: ensuring that it's the same device after the reconfiguration.
The thing is that if you replace your router with a new one (more powerful, etc.) should we make you remove the integration and all of its tracked devices and connected automatons? I don't think we should - the MACs of your devices will stay the same, and you most probably copied the config from the old device...
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Adds reconfiguration ability to Keenetic NDMS2 integration.
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: