Fix hvv_departures request time (#40195)
parent
2b151209b2
commit
d16c04a8e0
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue