Another SIA fix for timestamp not present. (#53045)

This commit is contained in:
Eduard van Valkenburg 2021-07-15 09:31:17 +02:00 committed by GitHub
parent 5ff9c3e611
commit f07d64c813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,9 @@ def get_attr_from_sia_event(event: SIAEvent) -> dict[str, Any]:
ATTR_CODE: event.code,
ATTR_MESSAGE: event.message,
ATTR_ID: event.id,
ATTR_TIMESTAMP: event.timestamp.isoformat(),
ATTR_TIMESTAMP: event.timestamp.isoformat()
if event.timestamp
else utcnow().isoformat(),
}