frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Enforce valid entity ID in card config YAML

Open spacegaier opened this issue 2 years ago • 2 comments

Breaking change

Proposed change

I am currently cleaning up the card config validation since we are missing a few options and the current validation setup is not really correct (allows too many actually invalid options). All of that will be in a separate PR though. I split this one out to add the existing entityId() validator into more places.

The other cards that are not covered by this PR will be in the other one, since in those files more changes occurred.

Note: I also ran "Organize imports" on those files so that the entityId() import is correctly sorted which is why the changes seem bigger than they actually are.

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)
  • [X] Code quality improvements to existing code or addition of tests

Example configuration


Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • [X] The code change is tested and works locally.
  • [X] 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 avatar Dec 14 '22 22:12 spacegaier

Question: if you start typing a entity id, will it now jump to the yaml editor because it is not a valid entity id yet?

bramkragten avatar Dec 15 '22 14:12 bramkragten

Question: if you start typing a entity id, will it now jump to the yaml editor because it is not a valid entity id yet?

If you mean typing in the entity selectors of the visual editor, then no (and I think we have only card editors with entity selectors by this point?). They only take effect once a value has been selected and that value anyway should be valid if returned from the selector.

If you mean something else ... then I am missing your point probably 😆

spacegaier avatar Dec 15 '22 16:12 spacegaier