restored the old use of the units attribute for backwards compatibility
@@ -397,6 +397,11 @@ class BaseSensor(RestoreEntity, SensorEntity):
self.ready_for_update = True
return
+ try:
+ self._attr_native_unit_of_measurement = old_state.unit_of_measurement
+ except AttributeError:
+ pass
+
try:
self._attr_native_unit_of_measurement = old_state.attributes["unit_of_measurement"]
except AttributeError:
