From 9b0c14d0b2cba44c2645f8c07c769b7725c4e974 Mon Sep 17 00:00:00 2001 From: Chris Turra Date: Sat, 16 Oct 2021 12:16:29 -0700 Subject: [PATCH] adding default to round() examples to be compliant new validation (#19800) --- source/_integrations/template.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/template.markdown b/source/_integrations/template.markdown index 5781e761fc7..cd018e79119 100644 --- a/source/_integrations/template.markdown +++ b/source/_integrations/template.markdown @@ -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" ```