adding default to round() examples to be compliant new validation (#19800)

This commit is contained in:
Chris Turra 2021-10-16 12:16:29 -07:00 committed by GitHub
parent d1fa0eb725
commit 9b0c14d0b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ template:
{% set bedroom = states('sensor.bedroom_temperature') | float %}
{% set kitchen = states('sensor.kitchen_temperature') | float %}
{{ ((bedroom + kitchen) / 2) | round(1) }}
{{ ((bedroom + kitchen) / 2) | round(1, default=0) }}
```
{% endraw %}
@ -86,8 +86,8 @@ template:
minutes: 0
sensor:
# Keep track how many days have past since a date
- name: Not smoking
state: '{{ ( ( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round }}'
- name: "Not smoking"
state: '{{ ( ( as_timestamp(now()) - as_timestamp(strptime("06.07.2018", "%d.%m.%Y")) ) / 86400 ) | round(default=0) }}'
unit_of_measurement: "Days"
```