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

Feature request: a template result is available as a variable #97

Open
zulu64 opened this issue Dec 3, 2022 · 0 comments
Open

Feature request: a template result is available as a variable #97

zulu64 opened this issue Dec 3, 2022 · 0 comments

Comments

@zulu64
Copy link

zulu64 commented Dec 3, 2022

Hi @thomasloven
I would like to request an enhancement to the "default" option.

Currently

If the entity: template option is used, the result is computed and the state switch mechanism directs to the appropriate "state". The default: x option takes care of unknown/unrecognised states.

Issue

If the state is unknown/unrecognised, the default code doesn't know what the actual state value is/was.
This prevents at least 2 scenarios useful to developers:

  • Debugging - what state value was actually computed?
  • Parameters - the actual state value could be passed on to a child card for processing i.e. routing decisions, display etc.

Proposed solution

An implicit variable is available within the card and is accessed the same way as the existing variables.
I propose the name: state.result (up to you of course).
It may make sense to populate this variable with a result for all other entity types too to promote and facilitate generic code.
e.g. hash, user, group, deviceID, and mediaquery

Thanks for this useful card.
Guy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant