mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +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
|
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…
x
Reference in New Issue
Block a user