alexa_media_player: Alexa media fails to load in Home assistant dev (2021.12)

Describe the bug In the daily/dev build, alexa media player fails to load. It seems something in the backend changed. I updated to the current daily (11/6) and this error is in the logs:

2021-11-07 05:04:27 ERROR (MainThread) [homeassistant.setup] Setup failed for alexa_media: unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 206, in _async_setup_component
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 522, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/__init__.py", line 16, in <module>
    from .alexaapi import AlexaAPI
  File "/usr/local/lib/python3.9/site-packages/alexapy/alexaapi.py", line 21, in <module>
    from alexapy.aiohttp import ClientConnectionError, ClientResponse
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str

To Reproduce Update to the latest dev version and load alexa_meda

Expected behavior For it to work.

Screenshots N/A

System details

  • Home-assistant (version): supervisor-2021.11.dev0401
  • Hassio (Yes/No): Supervised.
  • alexa_media (version from const.py or HA startup): v3.10.10
  • alexapy (version from pip show alexapy or HA startup): 1.25.1
  • Amazon 2FA is enabled (y/n). We will not debug login issues if unanswered: y

Logs Please provide logs. We’ll be most likely asking for them anyway.

2021-11-07 05:04:27 ERROR (MainThread) [homeassistant.setup] Setup failed for alexa_media: unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 206, in _async_setup_component
    component = integration.get_component()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 522, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/alexa_media/__init__.py", line 16, in <module>
    from alexapy import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/__init__.py", line 16, in <module>
    from .alexaapi import AlexaAPI
  File "/usr/local/lib/python3.9/site-packages/alexapy/alexaapi.py", line 21, in <module>
    from alexapy.aiohttp import ClientConnectionError, ClientResponse
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/__init__.py", line 6, in <module>
    from .client import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/client.py", line 35, in <module>
    from . import hdrs, http, payload
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http.py", line 7, in <module>
    from .http_parser import (
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/http_parser.py", line 15, in <module>
    from .helpers import NO_EXTENSIONS, BaseTimerContext
  File "/usr/local/lib/python3.9/site-packages/alexapy/aiohttp/helpers.py", line 667, in <module>
    class CeilTimeout(async_timeout.timeout):
TypeError: function() argument 'code' must be code, not str

Additional context Add any other context about the problem here.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Dev will also get the latest version. It’s currently identical to 3.10.15. Obviously dev may get updated in the future so I’d advise you to grab a numbered release.