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

Trigger_updates template support #558

Closed
basbruss opened this issue Feb 17, 2022 · 2 comments
Closed

Trigger_updates template support #558

basbruss opened this issue Feb 17, 2022 · 2 comments

Comments

@basbruss
Copy link

basbruss commented Feb 17, 2022

Is your feature request related to a problem? Please describe.
triggers_update: "all" does not always the right job when using some more advanced javascript.
For instance to many updates for some templates occur, which in this case changes the color to often:
But when not using triggers_update: "all" not all variables states do update directly.

variables:  
  color: >
        [[[
          var colors = ['yellow', 'blue', 'red', 'purple','green', 'pink'];
          var color = colors[Math.floor(Math.random() * colors.length)];
          return color;
        ]]]

Describe the solution you'd like
Add support for extracting a string from javascript: triggers_update: "[[[ return variables.my_variable ]]]"
So you only have to specify an entity once to a variable instead of adding to a variable and adding to the triggers update list.

@basbruss basbruss added the FR Feature Request label Feb 17, 2022
github-actions bot pushed a commit that referenced this issue Jul 30, 2023
## [4.1.0-dev.1](v4.0.1...v4.1.0-dev.1) (2023-07-30)

### Features

* **templates:** Support for one time evaluation of js templates in `triggers_update` and `entity` ([#741](#741)) ([b372642](b372642)), closes [#618](#618) [#558](#558) [#368](#368)

### Bug Fixes

* Keep default background color for color_type: card when off ([41dea3f](41dea3f)), closes [#737](#737)
@github-actions
Copy link

🎉 This issue has been resolved in version 4.1.0-dev.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Aug 3, 2023
## [4.1.0](v4.0.1...v4.1.0) (2023-08-03)

### Features

* **templates:** Support for one time evaluation of js templates in `triggers_update` and `entity` ([#741](#741)) ([b372642](b372642)), closes [#618](#618) [#558](#558) [#368](#368)

### Bug Fixes

* Keep default background color for color_type: card when off ([41dea3f](41dea3f)), closes [#737](#737)
* lock would not display on many browsers ([245441b](245441b)), closes [#740](#740)
* remove margin-top on name/label/state introduced with 4.0.0 which broke many cards ([53fee75](53fee75)), closes [#742](#742) [#744](#744)
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

🎉 This issue has been resolved in version 4.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

No branches or pull requests

1 participant