Fix station parser problem in Trafikverket Train (#139035)

pull/139032/head^2
G Johansson 2025-02-22 13:35:23 +01:00 committed by GitHub
parent 9a1f2b52cd
commit f5263203f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 2 deletions

View File

@ -101,6 +101,9 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
_from_stations: list[StationInfoModel]
_to_stations: list[StationInfoModel]
_time: str | None
_days: list
_product: str | None
_data: dict[str, Any]
@staticmethod
@ -243,8 +246,10 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle the select station step."""
if user_input is not None:
api_key: str = self._data[CONF_API_KEY]
train_from: str = user_input[CONF_FROM]
train_to: str = user_input[CONF_TO]
train_from: str = (
user_input.get(CONF_FROM) or self._from_stations[0].signature
)
train_to: str = user_input.get(CONF_TO) or self._to_stations[0].signature
train_time: str | None = self._data.get(CONF_TIME)
train_days: list = self._data[CONF_WEEKDAY]
filter_product: str | None = self._data[CONF_FILTER_PRODUCT]