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 Franck Nijhof
parent 4802157146
commit acf705a958

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(),
}