Fix vulcan integration (#91401)

This commit is contained in:
Antoni Czaplicki 2023-07-23 21:40:56 +02:00 committed by GitHub
parent 61f3f38c99
commit 860a37aa65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ from __future__ import annotations
from datetime import date, datetime, timedelta
import logging
from zoneinfo import ZoneInfo
from aiohttp import ClientConnectorError
from vulcan import UnauthorizedCertificateException
@ -107,8 +108,12 @@ class VulcanCalendarEntity(CalendarEntity):
event_list = []
for item in events:
event = CalendarEvent(
start=datetime.combine(item["date"], item["time"].from_),
end=datetime.combine(item["date"], item["time"].to),
start=datetime.combine(item["date"], item["time"].from_).astimezone(
ZoneInfo("Europe/Warsaw")
),
end=datetime.combine(item["date"], item["time"].to).astimezone(
ZoneInfo("Europe/Warsaw")
),
summary=item["lesson"],
location=item["room"],
description=item["teacher"],
@ -156,8 +161,12 @@ class VulcanCalendarEntity(CalendarEntity):
),
)
self._event = CalendarEvent(
start=datetime.combine(new_event["date"], new_event["time"].from_),
end=datetime.combine(new_event["date"], new_event["time"].to),
start=datetime.combine(
new_event["date"], new_event["time"].from_
).astimezone(ZoneInfo("Europe/Warsaw")),
end=datetime.combine(new_event["date"], new_event["time"].to).astimezone(
ZoneInfo("Europe/Warsaw")
),
summary=new_event["lesson"],
location=new_event["room"],
description=new_event["teacher"],