From 860a37aa65d863112cac2fbe4599f8d7d9c793d1 Mon Sep 17 00:00:00 2001 From: Antoni Czaplicki <56671347+Antoni-Czaplicki@users.noreply.github.com> Date: Sun, 23 Jul 2023 21:40:56 +0200 Subject: [PATCH] Fix vulcan integration (#91401) --- homeassistant/components/vulcan/calendar.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/vulcan/calendar.py b/homeassistant/components/vulcan/calendar.py index debf1f4ea0d..791ae9ee7c4 100644 --- a/homeassistant/components/vulcan/calendar.py +++ b/homeassistant/components/vulcan/calendar.py @@ -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"],