mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-20 15:56:51 +00:00
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
@ -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 %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user