Skip to content

Incorrect parameter for predictions command #1

@ViViDboarder

Description

@ViViDboarder

I'm seeing the following in my logs when using the client:

Making request to URL http://webservices.nextbus.com/service/publicJSONFeed?command=predictions&a=sf-muni&s=6659&routeTag=36
hass_1  | 2019-01-15 06:22:28 DEBUG (SyncWorker_0) [custom_components.nextbus] 
 {'copyright': 'All data copyright San Francisco Muni 2019.', 'Error': {'content': 'route parameter "r" must be specified in query string', 'shouldRetry': 'false'}}

I can reproduce and resolve with curl by switching the param name to r:

$ curl "http://webservices.nextbus.com/service/publicJSONFeed?command=predictions&a=sf-muni&s=6934&routeTag=36"
{"copyright":"All data copyright San Francisco Muni 2019.","Error":{"content":"route parameter \"r\" must be specified in query string","shouldRetry":"false"}}

$ curl "http://webservices.nextbus.com/service/publicJSONFeed?command=predictions&a=sf-muni&s=6934&r=36"
{"predictions":{"agencyTitle":"San Francisco Muni","routeTag":"36","routeTitle":"36-Teresita","direction":{"title":"Inbound to Forest Hill Station","prediction":{"isDeparture":"false","minutes":"26","seconds":"1608","tripTag":"8239605","vehicle":"8522","affectedByLayover":"true","block":"3603","dirTag":"36___I_N00","epochTime":"1547536388615"}},"stopTitle":"Woodside Ave & Hernandez Ave","stopTag":"6934"},"copyright":"All data copyright San Francisco Muni 2019."}

Seems like a quick fix on line 194.

I can submit a patch tomorrow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions