You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like async_get_data is proceeding to get connections info even if the response is not 200 (e.g,. ratelimiting with http 429) - do you think it helps if an error is raised when the quota is exceeded?
Sample exception raised in homeassistant when the ratelimiter of opendata.ch blocks you
Update for sensor.sbb_home_work fails
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 224, in async_update_ha_state
yield from self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 351, in async_device_update
yield from self.async_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/swiss_public_transport.py", line 129, in async_update
await self._opendata.async_get_data()
File "/usr/local/lib/python3.6/site-packages/opendata_transport/__init__.py", line 47, in async_get_data
self.from_id = data['from']['id']
KeyError: 'from'
Response from opendata.ch
Request URL: http://transport.opendata.ch/v1/connections?from=Bex&to=Vevey
Request Method: GET
Status Code: 429 Too Many Requests
{"errors":[{"message":"Rate limit error from timetable.search.ch: Too many requests, try again tomorrow."}]}
Cheers,
The text was updated successfully, but these errors were encountered:
Thank you Fabian, I will submit a pull request and see how can we reduce number of calls made to api (e.g,. call the api only just before the next known train time in a rate optimized mode controlled by a flag,...) in home assistant.
Fabian,
It looks like
async_get_data
is proceeding to get connections info even if the response is not 200 (e.g,. ratelimiting with http 429) - do you think it helps if an error is raised when the quota is exceeded?Sample exception raised in homeassistant when the ratelimiter of opendata.ch blocks you
Response from opendata.ch
{"errors":[{"message":"Rate limit error from timetable.search.ch: Too many requests, try again tomorrow."}]}
Cheers,
The text was updated successfully, but these errors were encountered: