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

Filter canceled trains #63

Closed
libelle13 opened this issue Nov 19, 2023 · 3 comments
Closed

Filter canceled trains #63

libelle13 opened this issue Nov 19, 2023 · 3 comments
Assignees
Labels
feature New feature or request

Comments

@libelle13
Copy link

Hi,
I'm using VVSPY since 1 year as HomaAssistant integration and I'm very happy. I'm requesting all departures for station 'Universität' every 2 mins.
On Thursday, 16.11.2023 the S-Bahn did not operate at all in the morning due to union strike. My request with vvspy received still all S-Bahn trains - with zero delay :-), which was obviousely wrong.
The VVS website did not show the S-Bahn trains.
Is there an additional filter, i can apply for canceled trains?

Kind Regards & Thanks for your great work!
Ralf

@libelle13 libelle13 added the feature New feature or request label Nov 19, 2023
@zaanposni
Copy link
Owner

zaanposni commented Nov 19, 2023

Hi Ralf,

Thanks for your kind words. If you want to get your project mentioned in vvspy's readme, simply create a Pull Request :)

I made some checks and could not find any information regarding the strike in the API response either.
Btw, you can access the raw response on nearly all objects; It's called raw.

from datetime import datetime

from vvspy import get_departures


last_thursday = datetime(2023, 11, 16, 5, 0, 0)

deps = get_departures("de:08111:6008", check_time=last_thursday)

print(deps[0].raw)

Using lineInfos I have found some information about the ongoing nightly "Instandhaltungsarbeiten". I think this is the place the DB would post strike information as well.

"lineInfos": {
        "lineInfo": {
            "infoLinkText": "Hauptbahnhof - Vaihingen: Fahrplanänderungen in 26 Nächten Montag/Dienstag wegen der Instandhaltungsarbeiten",
            "infoLinkURL": "http://noHost",
            "infoText": {
                "content": "Auch im Jahr 2023 müssen wieder planmäßige Instandhaltungsarbeiten an der Stammstrecke zwischen Hauptbahnhof (tief) und Vaihingen durchgeführt werden.\n \nIn 26 Nächten von Montag auf Dienstag kommt es jeweils zwischen 22:30 und 04:30 zu folgenden Fahrplanänderungen bei der S-Bahn:\n \nDie Linie S1 wird zwischen Hauptbahnhof (oben) und Vaihingen ohne Halt umgeleitet. Die S3 fährt nur zwischen Backnang und Hauptbahnhof (oben), die S4 zwischen Backnang bzw. Marbach und Hauptbahnhof (oben) und die S6 zwischen Weil der Stadt und Hauptbahnhof (oben). Die S2 und S5 fahren durch den S-Bahn-Tunnel zu geänderten Fahrzeiten.",
                "subtitle": "Hauptbahnhof - Vaihingen: Fahrplanänderungen in 26 Nächten Montag/Dienstag wegen der Instandhaltungsarbeiten",
                "subject": "Linien S1, S2, S3, S4, S5, S6",
                "additionalText": "",
                "htmlText": "<div>Auch im Jahr 2023 m&uuml;ssen wieder planm&auml;&szlig;ige Instandhaltungsarbeiten an der Stammstrecke zwischen Hauptbahnhof (tief) und Vaihingen durchgef&uuml;hrt werden.</div>\n<div>&nbsp;</div>\n<div>In 26 N&auml;chten von Montag auf Dienstag kommt es jeweils zwischen 22:30 und 04:30 zu folgenden Fahrplan&auml;nderungen bei der S-Bahn:</div>\n<div>&nbsp;</div>\n<div>Die Linie S1 wird zwischen Hauptbahnhof (oben) und Vaihingen ohne Halt umgeleitet. Die S3 f&auml;hrt nur zwischen Backnang und Hauptbahnhof (oben), die S4 zwischen Backnang bzw. Marbach und Hauptbahnhof (oben) und die S6 zwischen Weil der Stadt und Hauptbahnhof (oben). Die S2 und S5 fahren durch den S-Bahn-Tunnel zu ge&auml;nderten Fahrzeiten.</div>",
                "wmlText": "",
                "smsText": "Linien S1, S2, S3, S4, S5, S6",
                "speechText": ""
            },
        }
   }

As far your comment regarding the official VVS website, maybe they have updated it since I created vvspy a few years ago ;)

I currently do not have the free time to rework vvspy or research if the API received any updates, so I cannot help you with your request :(

@zaanposni
Copy link
Owner

zaanposni commented Nov 19, 2023

@libelle13 Nice to know:

This won't help you regarding the strikes, but the API responses for trips and departures/arrivals are different.
Sometimes you will find additional information in one type that is missing in the other.

Maybe this will help you to improve your project.

@zaanposni
Copy link
Owner

Closing this issue as I think there is no way for vvspy to reliably obtain this information

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

No branches or pull requests

2 participants