From 9dd7611c9206dfbb1bd2ade874c2b5074bc0cb21 Mon Sep 17 00:00:00 2001 From: David Beitey Date: Wed, 24 Apr 2019 02:40:18 +1000 Subject: [PATCH] Fix indenting of template component examples (#9282) --- source/_components/template.markdown | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/_components/template.markdown b/source/_components/template.markdown index 5d6c2ff2a8f..564fe2cb061 100644 --- a/source/_components/template.markdown +++ b/source/_components/template.markdown @@ -260,13 +260,13 @@ This template contains no entities that will trigger an update, so we add an `en {% raw %} ```yaml sensor: -- platform: template - sensors: - nonsmoker: - value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}' - entity_id: sensor.date - friendly_name: 'Not smoking' - unit_of_measurement: "Days" + - platform: template + sensors: + nonsmoker: + value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}' + entity_id: sensor.date + friendly_name: 'Not smoking' + unit_of_measurement: "Days" ``` {% endraw %} @@ -277,13 +277,13 @@ An alternative to this is to create an interval-based automation that calls the {% raw %} ```yaml sensor: -- platform: template - sensors: - nonsmoker: - value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}' - entity_id: [] - friendly_name: 'Not smoking' - unit_of_measurement: "Days" + - platform: template + sensors: + nonsmoker: + value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}' + entity_id: [] + friendly_name: 'Not smoking' + unit_of_measurement: "Days" automation: - alias: 'nonsmoker_update'