mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 00:37:13 +00:00
always sync unit_of_measurement (#44670)
This commit is contained in:
parent
687f90e164
commit
b290a8b5a1
@ -145,13 +145,7 @@ class UtilityMeterSensor(RestoreEntity):
|
||||
):
|
||||
return
|
||||
|
||||
if (
|
||||
self._unit_of_measurement is None
|
||||
and new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is not None
|
||||
):
|
||||
self._unit_of_measurement = new_state.attributes.get(
|
||||
ATTR_UNIT_OF_MEASUREMENT
|
||||
)
|
||||
self._unit_of_measurement = new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||
|
||||
try:
|
||||
diff = Decimal(new_state.state) - Decimal(old_state.state)
|
||||
|
Loading…
x
Reference in New Issue
Block a user