From d16c04a8e06e023626ae74e465c0044a20904bdd Mon Sep 17 00:00:00 2001 From: Tom Schneider Date: Fri, 16 Oct 2020 10:07:24 +0200 Subject: [PATCH] Fix hvv_departures request time (#40195) --- homeassistant/components/hvv_departures/sensor.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/hvv_departures/sensor.py b/homeassistant/components/hvv_departures/sensor.py index d3a02462eb9..d6957e6beec 100644 --- a/homeassistant/components/hvv_departures/sensor.py +++ b/homeassistant/components/hvv_departures/sensor.py @@ -4,6 +4,7 @@ import logging from aiohttp import ClientConnectorError from pygti.exceptions import InvalidAuth +from pytz import timezone from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID, DEVICE_CLASS_TIMESTAMP from homeassistant.helpers import aiohttp_client @@ -65,11 +66,13 @@ class HVVDepartureSensor(Entity): minutes=self.config_entry.options.get("offset", 0) ) + departure_time_tz_berlin = departure_time.astimezone(timezone("Europe/Berlin")) + payload = { "station": self.config_entry.data[CONF_STATION], "time": { - "date": departure_time.strftime("%d.%m.%Y"), - "time": departure_time.strftime("%H:%M"), + "date": departure_time_tz_berlin.strftime("%d.%m.%Y"), + "time": departure_time_tz_berlin.strftime("%H:%M"), }, "maxList": MAX_LIST, "maxTimeOffset": MAX_TIME_OFFSET,