-
Notifications
You must be signed in to change notification settings - Fork 103
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
Ability to edit/update config entries #377
Comments
Agreed. Something like this is definitely needed. |
I think something like @SeanPM5 posted would be great (👍 for that), but thats probably seperate to a discussion about editing config entries as yaml? |
I'm thinking this could be a bit more generic call to action. Hopefully the integration could set the action string and button title. For "Pairing Required [Pair]" |
I think that we can solve this using the UI and existing infrastructure.
|
Since not all entries have a unique id, I think passing in the config entry id would make sense to start updating a flow. I expect every integration would have the config entry id since the failure they are trapping or seeing would be inside the setup which knows it. |
What about for point 4? If the user aborts an update flow for a failed config entry without completing, the flow would be removed from the UI and the integration would remain in a broken state without an obvious indication. Having a persistent card for a config entry that needs attention would be good for usability. It would stay there until either the update flow is successfully completed or if the user deletes the existing broken config entry. |
I think that we should require a unique ID for updating a config entry. How else will we be able to refer to it? I've added For aborting the flow, let's make sure that's not allowed :) Maybe add something to |
I'm probably missing the big picture on this, but is there a case where you want to update the config entry from outside of the integration where you won't know the |
Very good point 😆 |
Couldn't we use the |
Maybe a new step in the config flow |
It might be nice to |
I think that the approach that MQTT is taking is fine as a solution for now: it uses an options flow and it will update data in the config entry before finishing the options flow with a create entry: home-assistant/core#36537 |
Supporting reconfiguration of devices without unique ID's would be helpful for certain types of devices such as the hlk-sw16 which is a 16 switch device that does not have hardware backed unique ID's at all. Being able to move the device to a different IP/port without reconfiguration of the 16 switch entities would be quite helpful.
Would this approach be useable for hardware like the hlk-sw16? |
Here is another approach https://github.com/home-assistant/core/pull/38341/files |
I think the main issue with that approach is that it's not really possible to trigger the reauth flow manually. For devices like the hlk-sw16 that don't use authentication the reconfigure would have to be manually triggered from my understanding. |
This architecture issue is old, stale, and possibly obsolete. Things changed a lot over the years. Additionally, we have been moving to discussions for these architectural discussions. For that reason, I'm going to close this issue. ../Frenck |
Context
With the move away from YAML configuration for integrations, there's a clear need for the ability to allow the user to edit/update config entries without touching
.storage/
by hand. Config entries can be updated from within the integrations today, but the exposed workflow for this process needs polish.Besides the user-initiated decisions to edit an existing integration's config, there's also no good way for the integration to mark itself as failed (e.g., auth credentials invalidated). The integration can begin a new config flow to update the existing by reusing the same
entry_id
, but it will show up as a duplicated "Discovered" integration in the UI.Summary of known problems:
async_abort
norasync_create_entry
seem applicable to this use case.ConfigFlow_abort_if_unique_id_configured
can be used as a convenience, but it will tell the user the setup has been aborted which is confusing.Proposal
Some point-by-point suggestions for the problems above:
SOURCE_EDIT
) which can be called either by the UI or from the integration during runtime.ConfigFlow._update_if_unique_id_configured
) which will update an existing config entry. Question: should this also unload/reload a failed entry?SOURCE_EDIT
step mentioned in point 1.Consequences
Editing/updating existing config entries should become more usable to the user and more obvious on how to implement to the maintainers. The benefit of easy editability of YAML with the benefits of runtime validation for config flows can both be realized when using the config entry model.
The text was updated successfully, but these errors were encountered: