Skip to content

Commit e6e97c5

Browse files
rtasarzRobert Tasarz
andauthored
fix: use dot instead of colon for microsecond separator of last_replaced in strftime (Python 3.14 compatibility) (#4391)
Co-authored-by: Robert Tasarz <robert.tasarz@codewedo.com>
1 parent 34609cf commit e6e97c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/battery_notes/coordinator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ def __init__( # noqa: PLR0912
192192

193193
if device_entry and device_entry.created_at.year > 1970:
194194
last_replaced = device_entry.created_at.strftime(
195-
"%Y-%m-%dT%H:%M:%S:%f"
195+
"%Y-%m-%dT%H:%M:%S.%f"
196196
)
197197
elif self.source_entity_id:
198198
entity = entity_registry.async_get(self.source_entity_id)
199199
if entity and entity.created_at.year > 1970:
200-
last_replaced = entity.created_at.strftime("%Y-%m-%dT%H:%M:%S:%f")
200+
last_replaced = entity.created_at.strftime("%Y-%m-%dT%H:%M:%S.%f")
201201

202202
_LOGGER.debug(
203203
"Defaulting %s battery last replaced to %s",

0 commit comments

Comments
 (0)