We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6537ee3 commit 08127b3Copy full SHA for 08127b3
1 file changed
custom_components/battery_notes/coordinator.py
@@ -667,13 +667,11 @@ def last_reported(self) -> datetime | None:
667
self.device_id
668
)
669
670
- if entry:
671
- if LAST_REPORTED in entry:
672
- if entry[LAST_REPORTED]:
673
- last_reported_date = datetime.fromisoformat(
674
- str(entry[LAST_REPORTED]) + "+00:00"
675
- )
676
- return last_reported_date
+ if entry and LAST_REPORTED in entry and entry[LAST_REPORTED] is not None:
+ entry_last_reported = str(entry[LAST_REPORTED])
+ if not entry_last_reported.endswith("+00:00"):
+ entry_last_reported += "+00:00"
+ return datetime.fromisoformat(entry_last_reported)
677
678
return None
679
0 commit comments