[Bug]: Cannot serialize non-str key None
bugalexapy
### Describe the bug
Logs full of error messages
### To Reproduce
1. View log
### Expected behavior
Not have my logs spammed with error messages.
### Screenshots
<img width="1550" height="1313" alt="Image" src="https://github.com/user-attachments/assets/57281903-87a8-4a85-b181-a0a765569741" />
<img width="1550" height="758" alt="Image" src="https://github.com/user-attachments/assets/bf6ee216-3447-4708-84a7-281364ca42b2" />
<img width="1554" height="475" alt="Image" src="https://github.com/user-attachments/assets/c2e26d9b-b495-4bb9-a7cf-c3dbf6a78acd" />
### Home Assistant Version
2026.5.1
### Alexa Media Player Version
5.15.2
### Alexa Media Player API library Version
unable to locate
### Have you entered a 52-character key for Amazon 2SV via Authenticator App login?
Yes
### Is the HA core integration Alexa Devices installed?
Yes
### Amazon Domain
amazon.co.uk (UK)
### Amazon Domain (if Other)
_No response_
### Debug Logs (alexa_media & alexapy)
```text
Logger: custom_components.alexa_media
Source: custom_components/alexa_media/__init__.py:1626
Integration: Alexa Media Player (documentation, issues)
First occurred: 10:57:36 (33 occurrences)
Last logged: 11:03:19
c********s@g*******m: last_called probe API TypeError (PUSH_VOLUME_CHANGE): Cannot serialize non-str key None
Traceback (most recent call last):
File "/config/custom_components/alexa_media/__init__.py", line 1626, in _last_called_probe_worker
records = await AlexaAPI.get_customer_history_records(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "/usr/local/lib/python3.14/site-packages/alexapy/helpers.py", line 147, in wrapper
return await func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/alexapy/alexaapi.py", line 1589, in get_customer_history_records
response = await AlexaAPI._static_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<12 lines>...
)
^
File "/usr/local/lib/python3.14/site-packages/backoff/_async.py", line 151, in retry
ret = await target(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/alexapy/alexaapi.py", line 458, in _static_request
response = await getattr(session, method)(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<4 lines>...
)
^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client.py", line 788, in _request
resp = await handler(req)
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client.py", line 764, in _connect_and_send_request
resp = await req.send(conn)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/aiohttp/client_reqrep.py", line 1470, in send
await writer.write_headers(status_line, self.headers)
File "/usr/local/lib/python3.14/site-packages/aiohttp/http_writer.py", line 217, in write_headers
buf = _serialize_headers(status_line, headers)
File "aiohttp/_http_writer.pyx", line 148, in aiohttp._http_writer._serialize_headers
File "aiohttp/_http_writer.pyx", line 109, in aiohttp._http_writer._write_str_raise_on_nlcr
TypeError: Cannot serialize non-str key None
Log details (WARNING)
This error originated from a custom integration.
Logger: alexapy.helpers
Source: custom_components/alexa_media/__init__.py:1626
Integration: Alexa Media Player (documentation, issues)
First occurred: 10:57:36 (33 occurrences)
Last logged: 11:03:19
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'start_time': 1778924541799, 'end_time': 1778926658979, 'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'start_time': 1778924541799, 'end_time': 1778926669255, 'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'start_time': 1778924541799, 'end_time': 1778926679365, 'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'start_time': 1778924541799, 'end_time': 1778926689473, 'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'start_time': 1778924541799, 'end_time': 1778926699742, 'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
Log details (WARNING)
This error originated from a custom integration.
Logger: alexapy.helpers
Source: custom_components/alexa_media/__init__.py:1588
Integration: Alexa Media Player (documentation, issues)
First occurred: 10:51:34 (2 occurrences)
Last logged: 10:53:31
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f712fb4d0>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
alexaapi.get_customer_history_records((<alexapy.alexalogin.AlexaLogin object at 0x7f648d2a50>,), {'max_record_size': 10}): An error occurred accessing AlexaAPI: An exception of type TypeError occurred. Arguments: ('Cannot serialize non-str key None',)
```
### Additional context
_No response_
8 条评论