-
Notifications
You must be signed in to change notification settings - Fork 2
Make route_id in predictions_for_stop optional #1
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
Conversation
|
This is an interesting change that I'd like to consider, but I just updated the method to perform the filter that you proposed in the hass/core repo. Can you rebase and add this again? Coupled with a refactor in the HASS component, the coordinator can more efficiently request predictions using this method and filtering results in HASS. |
|
Your |
|
Since Home Assistant is really the only known use case, I could probably just remove it. I figured I’d try to cover bases to provide something backwards compatible, but I doubt there’s a good reason unless you don’t provide a route in the first place. |
ViViDboarder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are tests green? It might be good to add a test that verifies the resulting API call and that filtering is skipped. I only have tests for this method because the others basically just return the JSON result as received.
|
Added test, all tests green, removed redundant |
|
I just manually merged this because pre-commit hooks were failing. Thanks! |
The new NextBus/UmoIQ API supports URLs with the
route_idsegment omitted, likeapi/pub/v1/agencies/sfmta-cis/stops/7999/predictions. This is useful when multiple complementary routes use the same stop, such as the SFMTAN(light rail sharing traffic lane with cars and buses),NBUS(alternate bus service), andNOWL(overnight bus service).This PR extends the
predictions_for_stopAPI by making theroute_idparam optional. I have tested this both with and without the parameter provided. I have also bumped the version.I would like to integrate this functionality into the ha nextbus integration so that a single entity can optionally represent the combined predictions for all routes at a stop.