Time-based templates update automatically now#15360
Conversation
bdraco
left a comment
There was a problem hiding this comment.
Looks good. I didn't have anything else useful to add.
|
|
||
| For example, you would replace {% raw %}`{{ states.switch.source.state == 'on' }}`{% endraw %} with this equivalent that returns `true`/`false` and never gives an unknown result: {% raw %}`{{ is_state('switch.source', 'on') }}`{% endraw %} | ||
|
|
||
| ### Working without entities |
There was a problem hiding this comment.
These sections still apply, right?
{{ range(0,100)|random }}
There was a problem hiding this comment.
The random does not cause automatic updates but I don't think it's worth having these sections just for that, it would cause confusion rather than clear it up IMO.
There was a problem hiding this comment.
Honestly, I do not agree, especially since I'm not making the example above up. It was a genuine question I had from people.
I don't see how that example is any different from now(). Just because now() is handled, doesn't render these sections invalid.
There was a problem hiding this comment.
Okay but the text removed here never did much to address random. I added a new subsection about this question in #15394.
Proposed change
Using
now()will now cause a template to update automatically so we can remove all the tricks for working around it not doing that.Type of change
currentbranch).currentbranch).nextbranch).nextbranch).Additional information
Checklist
currentbranch.nextbranch.