mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-12 20:06:33 +00:00
Avoid watching all states in the default template (#6918)
This commit is contained in:
parent
7fa9f10c30
commit
b9699f745f
@ -31,10 +31,9 @@ The temperature is {{ my_test_json.temperature }} {{ my_test_json.unit }}.
|
||||
The sun will rise at {{ as_timestamp(strptime(state_attr("sun.sun", "next_rising"), "")) | timestamp_local }}.
|
||||
{%- endif %}
|
||||
|
||||
For loop example getting 3 entity values:
|
||||
For loop example getting entity values in the weather domain:
|
||||
|
||||
{% for states in states | slice(3) -%}
|
||||
{% set state = states | first %}
|
||||
{% for state in states.weather -%}
|
||||
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
|
||||
{{ state.name | lower }} is {{state.state_with_unit}}
|
||||
{%- endfor %}.`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user