Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions RMVtransport/rmvtransport.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ async def get_departures(
direction_id: Optional[str] = None,
max_journeys: int = 20,
products: Optional[List[str]] = None,
time: Optional[str] = "now"
) -> RMVtravel:
"""Fetch data from rmv.de."""
url = self.build_journey_query(station_id, direction_id, max_journeys, products)
url = self.build_journey_query(station_id, direction_id, max_journeys, products, time)
xml = await self._query_rmv_api(url)
self.obj = extract_data_from_xml(xml)

Expand Down Expand Up @@ -85,16 +86,18 @@ def build_journey_query(
direction_id: Optional[str] = None,
max_journeys: int = 20,
products: Optional[List[str]] = None,
time: Optional[str] = "now"
) -> str:
"""Build query to request journey data."""
self.station_id = station_id
self.direction_id = direction_id
self.max_journeys = max_journeys
self.products_filter = product_filter(products or ALL_PRODUCTS)
self.time = time

params: Dict[str, Union[str, int]] = {
"selectDate": "today",
"time": "now",
"time": self.time,
"input": self.station_id,
"maxJourneys": self.max_journeys,
"boardType": "dep",
Expand Down