From 48084ee55e8b861e516184e636f6f5f9438448bf Mon Sep 17 00:00:00 2001 From: Ludeeus Date: Mon, 20 Mar 2017 20:09:34 +0100 Subject: [PATCH] Added round to battery precentage (#2309) Sometimes the battery will be show as a long string like: 28.99999999996%.. By adding "|round" this will be shown as 29% --- source/_cookbook/track_battery_level.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_cookbook/track_battery_level.markdown b/source/_cookbook/track_battery_level.markdown index 1305e0bdf36..eee8f1a4930 100644 --- a/source/_cookbook/track_battery_level.markdown +++ b/source/_cookbook/track_battery_level.markdown @@ -22,7 +22,7 @@ sensor: unit_of_measurement: '%' value_template: >- {% raw %}{%- if states.device_tracker.iphone.attributes.battery %} - {{ states.device_tracker.iphone.attributes.battery }} + {{ states.device_tracker.iphone.attributes.battery|round }} {% else %} {{ states.sensor.battery_iphone.state }} {%- endif %}{% endraw %}