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%
This commit is contained in:
parent
8e4f825ab7
commit
48084ee55e
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ sensor:
|
||||||
unit_of_measurement: '%'
|
unit_of_measurement: '%'
|
||||||
value_template: >-
|
value_template: >-
|
||||||
{% raw %}{%- if states.device_tracker.iphone.attributes.battery %}
|
{% raw %}{%- if states.device_tracker.iphone.attributes.battery %}
|
||||||
{{ states.device_tracker.iphone.attributes.battery }}
|
{{ states.device_tracker.iphone.attributes.battery|round }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ states.sensor.battery_iphone.state }}
|
{{ states.sensor.battery_iphone.state }}
|
||||||
{%- endif %}{% endraw %}
|
{%- endif %}{% endraw %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue