mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Fix station parser problem in Trafikverket Train (#139035)
This commit is contained in:
parent
9a1f2b52cd
commit
f5263203f5
@ -101,6 +101,9 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
_from_stations: list[StationInfoModel]
|
_from_stations: list[StationInfoModel]
|
||||||
_to_stations: list[StationInfoModel]
|
_to_stations: list[StationInfoModel]
|
||||||
|
_time: str | None
|
||||||
|
_days: list
|
||||||
|
_product: str | None
|
||||||
_data: dict[str, Any]
|
_data: dict[str, Any]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -243,8 +246,10 @@ class TVTrainConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
"""Handle the select station step."""
|
"""Handle the select station step."""
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
api_key: str = self._data[CONF_API_KEY]
|
api_key: str = self._data[CONF_API_KEY]
|
||||||
train_from: str = user_input[CONF_FROM]
|
train_from: str = (
|
||||||
train_to: str = user_input[CONF_TO]
|
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_time: str | None = self._data.get(CONF_TIME)
|
||||||
train_days: list = self._data[CONF_WEEKDAY]
|
train_days: list = self._data[CONF_WEEKDAY]
|
||||||
filter_product: str | None = self._data[CONF_FILTER_PRODUCT]
|
filter_product: str | None = self._data[CONF_FILTER_PRODUCT]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user