Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line number #18

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Conversation

polgarc
Copy link
Contributor

@polgarc polgarc commented Jan 13, 2024

Add line number, as the existing name field is not really that informative.

Extract from the output of the example.py:

http://transport.opendata.ch/v1/connections?from=Z%C3%BCrich%2C+Blumenfeldstrasse&to=Z%C3%BCrich+Oerlikon%2C+Bahnhof&limit=4&page=0&isArrivalTime=0&direct=0&sleeper=0&couchette=0&bike=0
Train connections: Zürich, Blumenfeldstrasse -> Zürich Oerlikon, Bahnhof
{0: {'departure': '2024-01-13T15:14:00+0100', 'duration': '00d00:11:00', 'delay': 0, 'transfers': 0, 'number': '012768', 'line': 'B61', 'platform': None}, 1: {'departure': '2024-01-13T15:29:00+0100', 'duration': '00d00:11:00', 'delay': 0, 'transfers': 0, 'number': '013090', 'line': 'B61', 'platform': None}, 2: {'departure': '2024-01-13T15:35:00+0100', 'duration': '00d00:15:00', 'delay': None, 'transfers': 0, 'number': '018659', 'line': 'S6', 'platform': None}, 3: {'departure': '2024-01-13T15:44:00+0100', 'duration': '00d00:11:00', 'delay': None, 'transfers': 0, 'number': '013439', 'line': 'B61', 'platform': None}}
{'departure': '2024-01-13T15:14:00+0100', 'duration': '00d00:11:00', 'delay': 0, 'transfers': 0, 'number': '012768', 'line': 'B61', 'platform': None}

'line': 'B61' means bus line 61, which is more informative than 'number': '013439'.

Other examples are

  • T10 (tram)
  • IR36 (train)
  • S16 (train)

Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good to me.

@fabaff fabaff merged commit 7d5fd96 into home-assistant-ecosystem:master Jan 24, 2024
3 checks passed
@polgarc polgarc deleted the add-line-number branch January 24, 2024 19:05
@polgarc
Copy link
Contributor Author

polgarc commented Jan 30, 2024

@fabaff thanks for the review and the merge. Could you please release 0.5.0 too? I'd like to use it in a Home Assistant change. Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants