From 20bfebd70c5b3f07bd9896a8d8f9cd43bf77240c Mon Sep 17 00:00:00 2001 From: Ember 'n0emis' Keske Date: Tue, 15 Oct 2024 22:00:16 +0200 Subject: [PATCH] fix(models): StationBoardLeg: mark direction as optional --- pyhafas/types/fptf.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyhafas/types/fptf.py b/pyhafas/types/fptf.py index cd3b38f..d759cf6 100644 --- a/pyhafas/types/fptf.py +++ b/pyhafas/types/fptf.py @@ -321,14 +321,14 @@ class StationBoardLeg(FPTFObject): :vartype id: str :ivar name: Name of the trip (e.g. ICE 123) :vartype name: str - :ivar direction: Direction text of the trip (e.g. Berlin Central Station) - :vartype direction: str :ivar station: FPTF `Station` object of the departing/arriving station :vartype station: Station :ivar date_time: Planned Date and Time of the departure/arrival :vartype date_time: datetime.datetime :ivar cancelled: Whether the stop or trip cancelled :vartype cancelled: bool + :ivar direction: Direction text of the trip (e.g. Berlin Central Station) + :vartype direction: Optional[str] :ivar delay: Delay at the departure station (maybe `None`) :vartype delay: Optional[datetime.timedelta] :ivar platform: Real-time platform at the station (maybe `None`) @@ -339,10 +339,10 @@ def __init__( self, id: str, name: str, - direction: str, station: Station, date_time: datetime.datetime, cancelled: bool, + direction: Optional[str] = None, delay: Optional[datetime.timedelta] = None, platform: Optional[str] = None ): @@ -351,18 +351,18 @@ def __init__( :param id: ID of the Leg :param name: Name of the trip (e.g. ICE 123) - :param direction: Direction text of the trip (e.g. Berlin Central Station) :param station: FPTF `Station` object of the departing/arriving station :param date_time: Planned Date and Time of the departure/arrival :param cancelled: Whether the stop or trip cancelled + :param direction: (optional) Direction text of the trip (e.g. Berlin Central Station) :param delay: (optional) Delay at the departure station. Defaults to `None` :param platform: (optional) Real-time platform at the station. Defaults to `None` """ self.id: str = id self.name: str = name - self.direction: str = direction self.station: Station = station self.dateTime: datetime.datetime = date_time self.cancelled: bool = cancelled + self.direction: Optional[str] = direction self.delay: Optional[datetime.timedelta] = delay self.platform: Optional[str] = platform