Alexa Media Player broke after December OS and Core updates

Something happened to my Alexa Media Player integration after I ran updates and have no clue how to resolve it.

I am now at:
core-2021.12.7
Home Assistant OS 7.0
supervisor-2021.12.2

Here is what is in the logs. Any help would be greatly appreciated.

2021-12-30 09:52:59 ERROR (MainThread) [homeassistant.setup] Setup failed for alexa_media: unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 181, 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

If you’ve installed via HACS, I believe the solution is

  • install latest version of HA (you’ve done that)
  • then install the updated version of Alexa Media Player (it’s not available in HACS until after you update)

I installed it manually earlier this year. HACS for whatever reason caused me problems so I removed it when I first started using HA.

I will look into re-installing it when I have time, it was quite a feat manually but will do it again. Thanks.

Hey mtnman, did you get Alexa working again? I followed:

And can get the alexa devices registered. But they are always unavailable.

I’ve the same behavior. Always unavailable. Could not find a solution yet
Anyone to help?

posted here my fix. Alexa Media Player Integration not working? - #29 by Vladi_Vladev