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

Bring HAFAS to HACS #1

Open
akloeckner opened this issue Jan 25, 2023 · 5 comments
Open

Bring HAFAS to HACS #1

akloeckner opened this issue Jan 25, 2023 · 5 comments

Comments

@akloeckner
Copy link
Owner

Hey @kilimnik,

I felt so free to take your work from home-assistant/core#78839 and cast it into a very preliminary HACS repository. You should be able to add this custom repository (https://github.com/akloeckner/hacs-hafas) to HACS (following this guide) and create a working Deutsche Bahn sensor (yeay):
grafik

However, I found a severe issue, that I wouldn't want to discuss in the HA PR. I noticed that my local Kölner Verkehrsbetriebe (KVB) was not available as a profile. So, I investigated how to add it as a profile. And it seems, that requires changing the pyhafas library. Which has several open PRs, partly dating way back to 2021. So, I got the feeling that this library might not be really maintained anymore. Even if it is maintained, every new company would require a code change. Do you think, that will be usable by the regular HA user?

Then again, if you think, that is doable, we could be close to having a working HACS integration. :-) Maybe polish the readme, fix some minor bugs on the way and advertise. ;-)

@kilimnik
Copy link
Collaborator

Oh, wow. I will check this out. Thank you for the work

I saw that the library is not greatly maintained. Unfortunately it's the best/only one out there. It would be possible to write the integration to use all the profiles, the library supports. But I am not sure, if that's needed. Most Trains and Busses in Germany are also queryable via the DB profile. I haven't seen any that are not.

@akloeckner
Copy link
Owner Author

Most Trains and Busses in Germany are also queryable via the DB profile.

Yes, that's a good argument. It will be sufficient for most users to just use the DB interface. In my case, I have noticed that DB is not as up-to-date as the local app is. But that might be an edge case. Which I should be able to fix with a single new profile.

I saw that the library is not greatly maintained.

Maybe, that will change once the user base becomes bigger through your integration. ;-)

@enjoysimpson
Copy link

Great work! I was able to install the integration via HACS. But unfortunatly, when trying to add a connection, I only get a message "unknown". I tried it with different towns (e.g. Berlin to Hannover) and the DB profile. Do I miss anything?
image

@akloeckner
Copy link
Owner Author

That's maybe something @kilimnik can help with. I remember to have seen a "non-speaking" error message like that, too. Then, I spelled the stations differently and it worked. So, I guess the "unknown" refers to the station name?

@akloeckner
Copy link
Owner Author

@kilimnik, I have invited you as an collaborator. But if you feel this project should live in your account, let's migrate it. I'm fine with either location.

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

No branches or pull requests

3 participants