mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Don't use unit_of_measurement in state attributes. (#30941)
This commit is contained in:
parent
4b67508330
commit
26fb1ce255
@ -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()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user