Skip to content
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

Use dynamic struct validation for entities card rows #9962

Merged
merged 3 commits into from Sep 6, 2021

Conversation

spacegaier
Copy link
Member

Breaking change

Proposed change

Currently in the entities card editor, we show a lot of false-positive warnings and errors which really confuses the users.

The reason is that as all the existing row configs were in a union and the validation logic checked them all and basically listed all combinations of potential issues. Now by using dynamic from superstruct we only check the config that matches the type of the row.

=> We now only show relevant errors to the user.

Before:

There are two errors here: The mandatory attribute key is missing plus the not yet supported icon key is there. But as the YAML input is not matching any row config, we see a huge list of false-positive errors.

image

image

After:
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@spacegaier spacegaier merged commit d6dbbcb into home-assistant:dev Sep 6, 2021
@spacegaier spacegaier deleted the entities-editor-dynamic branch September 6, 2021 08:27
@github-actions github-actions bot locked and limited conversation to collaborators Sep 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants