Fixed altStart and altEnd not being provided causing KeyError
All checks were successful
Tests / test (3.10) (push) Successful in 29s
Tests / test (3.11) (push) Successful in 28s
Tests / test (3.12) (push) Successful in 37s
Tests / test (3.9) (push) Successful in 27s

This commit is contained in:
2025-05-04 23:26:12 +02:00
parent c17a9d4206
commit 6ade6f7554

View File

@@ -81,8 +81,10 @@ class Message:
f"{data['validToDate']} {data['validToTime']}", "%Y-%m-%d %H:%M:%S"
)
)
self.date_start_alt: str = data["altStart"]
self.date_end_alt: str = data["altEnd"]
self.date_start_alt: Union[str, None] = (
None if "altStart" not in data else data["altStart"]
)
self.date_end_alt: Union[str, None] = None if "altEnd" not in data else data["altEnd"]
self.time_modified: Union[datetime, None] = (
None
if "modDate" not in data or "modTime" not in data