mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
fix for timestamp not present in SIA (#53015)
This commit is contained in:
parent
49d109a969
commit
7e16d38fc8
@ -6,6 +6,8 @@ from typing import Any
|
||||
|
||||
from pysiaalarm import SIAEvent
|
||||
|
||||
from homeassistant.util.dt import utcnow
|
||||
|
||||
from .const import ATTR_CODE, ATTR_ID, ATTR_MESSAGE, ATTR_TIMESTAMP, ATTR_ZONE
|
||||
|
||||
PING_INTERVAL_MARGIN = 30
|
||||
@ -42,7 +44,9 @@ def get_event_data_from_sia_event(event: SIAEvent) -> dict[str, Any]:
|
||||
"code": event.code,
|
||||
"message": event.message,
|
||||
"x_data": event.x_data,
|
||||
"timestamp": event.timestamp.isoformat(),
|
||||
"timestamp": event.timestamp.isoformat()
|
||||
if event.timestamp
|
||||
else utcnow().isoformat(),
|
||||
"event_qualifier": event.event_qualifier,
|
||||
"event_type": event.event_type,
|
||||
"partition": event.partition,
|
||||
|
Loading…
x
Reference in New Issue
Block a user