From b9699f745f8acb057e91b8719d1529049edaf2d5 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 10 Sep 2020 13:50:24 -0500 Subject: [PATCH] Avoid watching all states in the default template (#6918) --- .../developer-tools/template/developer-tools-template.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/panels/developer-tools/template/developer-tools-template.ts b/src/panels/developer-tools/template/developer-tools-template.ts index 0bb9d0f78e..fbc5e03b63 100644 --- a/src/panels/developer-tools/template/developer-tools-template.ts +++ b/src/panels/developer-tools/template/developer-tools-template.ts @@ -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 %}.`;