Show battery_level as a percent vs a decimal (#18328)

pull/18368/head
Chris Kacerguis 2018-11-10 14:30:03 -06:00 committed by Anders Melchiorsen
parent f236e14bd6
commit 667b41dd4a
1 changed files with 1 additions and 1 deletions

View File

@ -271,7 +271,7 @@ class WirelessTagBaseSensor(Entity):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_BATTERY_LEVEL: self._tag.battery_remaining,
ATTR_BATTERY_LEVEL: int(self._tag.battery_remaining*100),
ATTR_VOLTAGE: '{:.2f}V'.format(self._tag.battery_volts),
ATTR_TAG_SIGNAL_STRENGTH: '{}dBm'.format(
self._tag.signal_strength),