core: steam_online: steam.api.HTTPError: Server connection failed: Too Many Requests (429)

Home Assistant release with the issue: 0.92.2

Last working Home Assistant release (if known): N/A

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Component/platform: steam_online

Description of problem:

steam_online performs checks too often, which results in a permanent block. By default, the component should poll not as often, or alternatively, let the user specify a custom timeout.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

- platform: steam_online # https://www.home-assistant.io/components/steam_online/
  api_key: !secret steam_key
  accounts:
  - 76561197961984661 # nowaker

Traceback (if applicable):

2019-05-12 00:43:42 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.steam_76561197961984661 fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/steam/api.py", line 153, in download
    timeout=self._timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 429: Too Many Requests

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 220, in async_update_ha_state
    await self.async_device_update()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 377, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/steam_online/sensor.py", line 76, in update
    self._game = self._get_current_game()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/steam_online/sensor.py", line 92, in _get_current_game
    game_id = self._profile.current_game[0]
  File "/usr/local/lib/python3.7/site-packages/steam/user.py", line 171, in current_game
    obj = self._prof
  File "/usr/local/lib/python3.7/site-packages/steam/user.py", line 197, in _prof
    res = self._api["response"]["players"]
  File "/usr/local/lib/python3.7/site-packages/steam/api.py", line 220, in __getitem__
    return self.__handle_accessor("__getitem__", *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/steam/api.py", line 200, in __handle_accessor
    self.call()
  File "/usr/local/lib/python3.7/site-packages/steam/api.py", line 242, in call
    data = self._downloader.download()
  File "/usr/local/lib/python3.7/site-packages/steam/api.py", line 171, in download
    raise HTTPError("Server connection failed: {0} ({1})".format(reason, code))
steam.api.HTTPError: Server connection failed: Too Many Requests (429)

Additional information: N/A

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Can probably fix this issue.