always sync unit_of_measurement (#44670)
parent
687f90e164
commit
b290a8b5a1
|
@ -145,13 +145,7 @@ class UtilityMeterSensor(RestoreEntity):
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
if (
|
self._unit_of_measurement = new_state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
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
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
diff = Decimal(new_state.state) - Decimal(old_state.state)
|
diff = Decimal(new_state.state) - Decimal(old_state.state)
|
||||||
|
|
Loading…
Reference in New Issue