Don't use unit_of_measurement in state attributes. (#30941)

This commit is contained in:
Alexei Chetroi 2020-01-18 10:03:59 -05:00 committed by David F. Mulcahey
parent 4b67508330
commit 26fb1ce255

View file

@ -210,7 +210,7 @@ class Battery(Sensor):
def async_update_state_attribute(self, key, value):
"""Update a single device state attribute."""
if key == "battery_voltage":
self._device_state_attributes["voltage"] = f"{round(value/10, 1)}V"
self._device_state_attributes[key] = round(value / 10, 1)
self.async_schedule_update_ha_state()