Skip to content

Commit 69f7596

Browse files
Merge pull request #32 from endor-force:Fix-TrainStopStatus
Fix TrainStopStatus
2 parents 5133edc + 1949d8b commit 69f7596

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pytrafikverket/trafikverket_train.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,20 @@ def __init__(
9999
def get_state(self) -> TrainStopStatus:
100100
"""Retrieve the state of the departure."""
101101
if self.canceled:
102-
return TrainStopStatus.CANCELED.value
102+
return TrainStopStatus.CANCELED
103103
if (
104104
self.advertised_time_at_location is not None
105105
and self.time_at_location is not None
106106
and self.advertised_time_at_location != self.time_at_location
107107
):
108-
return TrainStopStatus.DELAYED.value
108+
return TrainStopStatus.DELAYED
109109
if (
110110
self.advertised_time_at_location is not None
111111
and self.estimated_time_at_location is not None
112112
and self.advertised_time_at_location != self.estimated_time_at_location
113113
):
114-
return TrainStopStatus.DELAYED.value
115-
return TrainStopStatus.ON_TIME.value
114+
return TrainStopStatus.DELAYED
115+
return TrainStopStatus.ON_TIME
116116

117117
def get_delay_time(self) -> timedelta | None:
118118
"""Calculate the delay of a departure."""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name="pytrafikverket",
10-
version="0.3.2",
10+
version="0.3.3",
1111
description="Retreive values from public API at the Swedish Transport Administration (Trafikverket).",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)