-
Notifications
You must be signed in to change notification settings - Fork 649
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
Addons with schema: false
are broken in 2021.02.5
#2540
Comments
That was stale documentation: home-assistant/developers.home-assistant#800 So we fix the bug and not created one :) |
That is evil. I doubt this is a good decision. |
You don't have to show them all? You can still make optional settings in a schema (I do that all the time). |
Any logical reason why extra options are bad? |
Extra options are not bad? You can mark them optional. |
I would lobby for bringing the old behavior back as well - this change has broken the room-assistant add-on for a lot of users without warning (or at least I didn't read anything about this before my users approached me on GitHub with the issue). Bringing the complex option tree under schema validation is quite difficult. Last time I tried I failed to depict the YAML tree using the schema correctly, which is the whole reason I disabled it. I would be interested to hear more about the reasoning for this change. EDIT:
This alone makes it impossible for me to write a schema for the room-assistant config. Only way to make it work is by making the application config YAML an inline document, which is a breaking change and isn't great from a UX point of view imo. EDIT 2: According to a conversation on Discord this limitation doesn’t really exist and was more meant as a recommendation. That would make some parts of my previous arguments void, but it still doesn’t allow for some flexibility features such as polytypes. Writing a schema is also still a time consuming task for projects with bigger configs. |
I really doubt if I will be able to create a valid json schema that would cover all the options I have in my addon. JSON schema format is so limited. |
If there is schema validation missing, please raise that separately. Thanks 👍 |
Forced schema validation has broken PAI add-on. I cannot seem to toll back to a previous version of Supervisor either using the HA CLI command. What can I do to roll back or should I apply an old snapshot? |
@pvizeli Even if you see your approach as the correct behavior, what was done was a breaking change without a prior notification. I can say I'm rather new to HA (using it for about two years) but the number of times the Supervisor updates is breaking things is pretty uneasy. Maybe a "postpone auto-updates for x days" CLI option when downgrading the Supervisor would be helpful. Even Windows 10 with their aggressive Updates allows for posponing them :). Think about it. |
@frenck and @pvizeli So with this "fix" you have broken 3 addons. Can you please at least tell us why this "fix" was required and what it actually solves? @frenck How can I specify in schema so a sub dict could have any keys and values?
And please reopen this issue if you do not want people to create another dozen of dupes. Our debate is in progress. Closing the issue before a solution is found is a bad manner. |
@yozik04 A schema can have dicts and subvalues, that has been available since the early beginnings. But a schema is explicit, "any" is not part of that. |
Yes, it is, it always has been. |
IMHO, that is a bad idea in general. I (personally) would not support it. |
@frenck Is it possible to make a configuration sub tree optional?
|
That is the same question you have asked above twice already in different words. If someone decides it should be part of the add-on configuration 🤷♂️ As for my personal opinion, I would not support that. |
No I mean this way:
Some hardware that we support does not have "optional" sub configuration. |
Options can be marked with a |
So only leaf nodes can be optional? |
The optionality is not limited to roots or leaves. It applies to a node by itself. |
So optionality in keys also supported? See |
{
"a": {
"b": ["int"],
"optional": ["int?"]
},
} that As one doesn't have to provide values?
|
@frenck "email?" and "device?" types does not want to be optional. Validation fails if we do not provide a value. |
all provided validation types should be able to support the optional flag. If you conclude that is not the case, please raise a separate issue for that with a reproduction scenario, so we can take a look at the reason for that. |
@frenck How does one specify an optional string value with default value "null" ?
|
@clau-bucur Lets not stack issues. Please raise a separate issue if you have a specific case. Thanks 👍 |
I'd say was a simple question related to the issue at hand. But ok. Thanks. |
@frenck Thank you for your answers. It was helpful. But you really like to skip questions or answer partially... That makes a negative effect. |
I'm sorry, it helps if an issue is created for a single thing. If you need a chat or support, please join our Discord server, as we have developer channels on there. |
workaround for home-assistant/supervisor#2540
Describe the issue
Home Assistant addons that does not specify configuration
schema
seems to be broken. All provided settings are filtered out.https://developers.home-assistant.io/docs/add-ons/configuration/ documentation tells:
If addon uses
schema: false
it will not be able to read any configuration from options.jsonExample config here: https://github.com/ParadoxAlarmInterface/hassio-repository/blob/master/paradox_alarm_interface/config.json
Supervisor just strips all configuration options out.
I think bug was introduced with this change: https://github.com/home-assistant/supervisor/pull/2510/files
Steps to reproduce
Enviroment details
Supervisor logs
Supervisor logs
System Information
System Information
The text was updated successfully, but these errors were encountered: