You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Home Assistant 2021.5 we're going to introduce strategies. A strategy is a JavaScript block that is executed on the loaded configuration before the dashboard as a whole or a specific view is being rendered.
It is the right spot to pre-process configurations and replace templates etc. The exact thing that decluttering-card does.
In the case of decluttering-card:
In generate dashboard add the decluttering strategy to each view.
Reading the gist, my understanding is that I'd have to loop over all cards, cards with cards inside and stacks etc... of the view to check if they need to be processed (else it would be quite slow...) in generateView? How would I know how to iterate over abstract objects (cards config) and find cards?
Also, would it still work if the user wants to use another strategy in addition to this one?
What would happen in the card editor with this new method?
In Home Assistant 2021.5 we're going to introduce strategies. A strategy is a JavaScript block that is executed on the loaded configuration before the dashboard as a whole or a specific view is being rendered.
It is the right spot to pre-process configurations and replace templates etc. The exact thing that decluttering-card does.
In the case of decluttering-card:
An example of a strategy is here: https://gist.github.com/balloob/bf2715efba46420d6ba1a01586946308 . Note, this example is purely generating a configuration, but as you can see, the original configuration is passed in as
info.config
.You will be able to play with a preview of this in the April 24 nightly.
The text was updated successfully, but these errors were encountered: