Skip to content

Commit bb5aaf1

Browse files
Fix last reported
1 parent 7466a49 commit bb5aaf1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

custom_components/battery_notes/device.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ async def async_setup(self) -> bool:
194194
device_entry = device_registry.async_get(entity.device_id)
195195

196196
if device_entry.created_at.year > 1970:
197-
last_replaced = device_entry.created_at.strftime("%Y-%m-%dT%H:%M:%S:%f")
197+
last_replaced = device_entry.created_at.strftime(
198+
"%Y-%m-%dT%H:%M:%S:%f"
199+
)
198200
else:
199201
entity = entity_registry.async_get(source_entity_id)
200202
if entity.created_at.year > 1970:
@@ -214,7 +216,7 @@ async def async_setup(self) -> bool:
214216
_LOGGER.debug(
215217
"Defaulting %s battery last reported to %s",
216218
source_entity_id or device_id,
217-
last_replaced,
219+
last_reported,
218220
)
219221
self.coordinator.last_reported = last_reported
220222

0 commit comments

Comments
 (0)