From 25d4f96e4db8b357835398d82439160328f72ada Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 4 May 2022 18:15:17 +0200 Subject: [PATCH] Add default to self-reference template example (#22624) --- source/_integrations/template.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/template.markdown b/source/_integrations/template.markdown index b0e0f093490..cb44109af07 100644 --- a/source/_integrations/template.markdown +++ b/source/_integrations/template.markdown @@ -578,7 +578,7 @@ This example demonstrates how the `this` variable can be used in templates for s template: - sensor: - name: test - state: "{{ this.attributes.test }}" + state: "{{ this.attributes.test | default('Value when missing') }}" # not: "{{ state_attr('sensor.test', 'test') }}" attributes: test: "{{ now() }}"