Closed rafaelmagu closed 1 year ago
Apologies for not reviewing this yet. I do like your generic approach much more. It seems like most of the forks are addressing this onesy twosy so might as well be flexible. Will put together some release notes. Would you mind writing up an example of "if this was your old config, here's how it would look now"?
@zacs to draw on the examples from the README:
Assuming this is your current config:
- platform: gtfs_rt
trip_update_url: 'https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-bdfm'
x_api_key: <api key>
departures:
- name: "Brooklyn F"
route: 'F'
stopid: 'F16S'
After this update, it needs to be updated to:
- platform: gtfs_rt
trip_update_url: 'https://api-endpoint.mta.info/Dataservice/mtagtfsfeeds/nyct%2Fgtfs-bdfm'
api_key: <api key> # <- Note key name change here
header_name: 'X-Api-Key' # <- Add a specific header name
departures:
- name: "Brooklyn F"
route: 'F'
stopid: 'F16S'
Thanks! I will cut the release and include these notes. 🙌
@zacs is there anything I can do to help merge this?
This would be helpful for Portland Oregon's Trimet as well, requiring an 'appID' header.
Thanks for the reminder here. I just merged #30 which adds support for custom headers without hard-coding in the specific headers themselves. I went with that one since it's non-breaking and long-term more flexible. @rafaelmagu and @CDeLeon94 would you mind trying it out now? Thanks!
This would be helpful for Portland Oregon's Trimet as well, requiring an 'appID' header.
Could you provide your config for as an example for Trimet? I'm in Lake Oswego and I'm trying to set this integration up for at least one stop.
Thanks in advance
This would be helpful for Portland Oregon's Trimet as well, requiring an 'appID' header.
Could you provide your config for as an example for Trimet? I'm in Lake Oswego and I'm trying to set this integration up for at least one stop.
Thanks in advance
https://github.com/CDeLeon94/GTFS-V2-Home-Assistant
This was my solution, still working in my system
This would be helpful for Portland Oregon's Trimet as well, requiring an 'appID' header.
Could you provide your config for as an example for Trimet? I'm in Lake Oswego and I'm trying to set this integration up for at least one stop.
Thanks in advance
https://github.com/CDeLeon94/GTFS-V2-Home-Assistant
This was my solution, still working in my system
Thanks for the response. In the meantime between my original comment and your response I came up with my own solution. I'm just invoking a python script against an endpoint and applying some filtering for the routes and buses I'm interested in.
Maybe I'll revisit this integration in the future. As of right now my solution works for me.
Thanks again for the response.
In order to support Auckland Transport's API, I need to set a custom authorization header name of
Ocp-Apim-Subscription-Key
.Breaking Changes This PR intentionally removes the
apikey
andx_api_key
parameters in favour of a simplerapi_key
/header_name
approach. Merging this PR will break existing setups (potentially), so I'm leaving this to the repo maintainer's discretion.