mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Show battery_level as a percent vs a decimal (#18328)
This commit is contained in:
parent
f236e14bd6
commit
667b41dd4a
@ -271,7 +271,7 @@ class WirelessTagBaseSensor(Entity):
|
|||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
return {
|
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_VOLTAGE: '{:.2f}V'.format(self._tag.battery_volts),
|
||||||
ATTR_TAG_SIGNAL_STRENGTH: '{}dBm'.format(
|
ATTR_TAG_SIGNAL_STRENGTH: '{}dBm'.format(
|
||||||
self._tag.signal_strength),
|
self._tag.signal_strength),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user