mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
Fix indenting of template component examples (#9282)
This commit is contained in:
parent
ad39b4733e
commit
9dd7611c92
@ -260,13 +260,13 @@ This template contains no entities that will trigger an update, so we add an `en
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
nonsmoker:
|
nonsmoker:
|
||||||
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}'
|
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}'
|
||||||
entity_id: sensor.date
|
entity_id: sensor.date
|
||||||
friendly_name: 'Not smoking'
|
friendly_name: 'Not smoking'
|
||||||
unit_of_measurement: "Days"
|
unit_of_measurement: "Days"
|
||||||
```
|
```
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
@ -277,13 +277,13 @@ An alternative to this is to create an interval-based automation that calls the
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
nonsmoker:
|
nonsmoker:
|
||||||
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}'
|
value_template: '{{ (( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(2) }}'
|
||||||
entity_id: []
|
entity_id: []
|
||||||
friendly_name: 'Not smoking'
|
friendly_name: 'Not smoking'
|
||||||
unit_of_measurement: "Days"
|
unit_of_measurement: "Days"
|
||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: 'nonsmoker_update'
|
- alias: 'nonsmoker_update'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user