-
Notifications
You must be signed in to change notification settings - Fork 55
Support reloading allow all imports through reload service and config entry options UI #42
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
Support reloading allow all imports through reload service and config entry options UI #42
Conversation
0e19499
to
23c7914
Compare
Thanks for the PR. Is the test failure related to home-assistant/core#41875? Even if home-assistant/core#41875 gets accepted, what will happen with older versions of HASS? |
Yes it is, and that's a fair question - for the two cases where I abort the flow (when someone tries to update through the UI an entry that was created through There are two options here:
Which would you prefer? |
I'd definitely prefer the backward compatible approach. |
d2efc85
to
b22e008
Compare
Thanks! So I can update the docs, I wanted to make sure I fully understand how
|
Yes, regardless of configuration type, it is possible to add
Correct - at least for now. Same reason as above - if you are using
Yes - let's say I set up via |
Thanks for the explanation. I'm planning on adding a new boolean config parameter, probably called Anyhow, I did notice a couple of things looking at the code:
|
Happy to review the changes you plan to make. re: |
I accepted your invite and looked through the code. It makes sense to me, the only thing is in your schema's in |
@raman325 - I found a bug related to reload that we need to fix. There are now two types of "reload" - calling the
I assume UI reload (Configuration -> Integrations -> Pyscript -> reload) should work the same as the Can an integration provide a function that is truly only called once at startup? If so, then the |
Good catch - when you reload through the Integrations UI,
I like option 1 better for cleanliness but I don't know what actions need to be taken. Is this enough information for you to proceed with a fix, or would you like me to investigate? |
I investigated. What I've done is moved the logic to delete all items from the Take a look at the changes: #53 - I am unclear on the best way to test this so I could use some help there assuming the logic makes sense |
As discussed in #39 , this change makes it possible to reload
allow_all_imports
via the reload service and also to configure it using the options menu for users who set up the entry through the UI (options will not work for users who do import, because when a user runs the reload service, and there is a mismatch between what's in the config and what was set in options, it would be impossible to know which one takes precedence. The config flow handles this gracefully and tells the user this if they attempt to access options for a config entry they defined inconfiguration.yaml
).I'm marking this as a draft because I discovered that my implementation won't work without home-assistant/core#41875
I can change the implementation to avoid this, but it would be a less desirable user experience so I am hoping that PR gets accepted.