Skip to content

Commit 48084ee

Browse files
ludeeusfabaff
authored andcommitted
Added round to battery precentage (home-assistant#2309)
Sometimes the battery will be show as a long string like: 28.99999999996%.. By adding "|round" this will be shown as 29%
1 parent 8e4f825 commit 48084ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/_cookbook/track_battery_level.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sensor:
2222
unit_of_measurement: '%'
2323
value_template: >-
2424
{% raw %}{%- if states.device_tracker.iphone.attributes.battery %}
25-
{{ states.device_tracker.iphone.attributes.battery }}
25+
{{ states.device_tracker.iphone.attributes.battery|round }}
2626
{% else %}
2727
{{ states.sensor.battery_iphone.state }}
2828
{%- endif %}{% endraw %}

0 commit comments

Comments
 (0)