Skip to content

Commit d4b9b76

Browse files
authored
Merge pull request SpanPanel#150 from SpanPanel/fix_energy_restore_attr_error
Fix energy restore attr error
2 parents 8d4aa23 + 3496f3f commit d4b9b76

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • custom_components/span_panel/sensors

custom_components/span_panel/sensors/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,10 @@ def extra_restore_state_data(self) -> SpanEnergyExtraStoredData:
416416
return SpanEnergyExtraStoredData(
417417
native_value=(
418418
float(self._attr_native_value)
419-
if isinstance(self._attr_native_value, (int | float))
419+
if isinstance(self._attr_native_value, int | float)
420420
else None
421421
),
422-
native_unit_of_measurement=self._attr_native_unit_of_measurement,
422+
native_unit_of_measurement=self.native_unit_of_measurement,
423423
last_valid_state=self._last_valid_state,
424424
last_valid_changed=(
425425
self._last_valid_changed.isoformat() if self._last_valid_changed else None

0 commit comments

Comments
 (0)