mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix hvv_departures request time (#40195)
This commit is contained in:
parent
2b151209b2
commit
d16c04a8e0
@ -4,6 +4,7 @@ import logging
|
|||||||
|
|
||||||
from aiohttp import ClientConnectorError
|
from aiohttp import ClientConnectorError
|
||||||
from pygti.exceptions import InvalidAuth
|
from pygti.exceptions import InvalidAuth
|
||||||
|
from pytz import timezone
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID, DEVICE_CLASS_TIMESTAMP
|
from homeassistant.const import ATTR_ATTRIBUTION, ATTR_ID, DEVICE_CLASS_TIMESTAMP
|
||||||
from homeassistant.helpers import aiohttp_client
|
from homeassistant.helpers import aiohttp_client
|
||||||
@ -65,11 +66,13 @@ class HVVDepartureSensor(Entity):
|
|||||||
minutes=self.config_entry.options.get("offset", 0)
|
minutes=self.config_entry.options.get("offset", 0)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
departure_time_tz_berlin = departure_time.astimezone(timezone("Europe/Berlin"))
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
"station": self.config_entry.data[CONF_STATION],
|
"station": self.config_entry.data[CONF_STATION],
|
||||||
"time": {
|
"time": {
|
||||||
"date": departure_time.strftime("%d.%m.%Y"),
|
"date": departure_time_tz_berlin.strftime("%d.%m.%Y"),
|
||||||
"time": departure_time.strftime("%H:%M"),
|
"time": departure_time_tz_berlin.strftime("%H:%M"),
|
||||||
},
|
},
|
||||||
"maxList": MAX_LIST,
|
"maxList": MAX_LIST,
|
||||||
"maxTimeOffset": MAX_TIME_OFFSET,
|
"maxTimeOffset": MAX_TIME_OFFSET,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user