alexa_media_player
alexa_media_player copied to clipboard
alexa_media.clear_history not working anymore
If I use it in an automation or directly call it via developer tools, I receive the following errors.
2022-09-25 10:05:37.457 WARNING (MainThread) [alexapy.helpers] alexaapi.clear_history((<alexapy.alexalogin.AlexaLogin object at 0x7f4e0475df60>, 50), {}): An error occured accessing AlexaAPI: An exception of type AttributeError occurred. Arguments:
("'NoneType' object has no attribute 'status'",)
2022-09-25 10:05:37.460 ERROR (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object has no attribute 'status'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/config/custom_components/alexa_media/helpers.py", line 156, in _catch_login_errors
result = await func(*args, **kwargs)
File "/config/custom_components/alexa_media/services.py", line 113, in clear_history
await AlexaAPI.clear_history(login_obj, items)
File "/usr/local/lib/python3.10/site-packages/alexapy/helpers.py", line 141, in wrapper
return await func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/alexapy/alexaapi.py", line 1636, in clear_history
if response.status == 404:
AttributeError: 'NoneType' object has no attribute 'status'
2022-09-25 10:05:37.464 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139973232099440] Error handling message: Unknown error (unknown_error)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 646, in handle_execute_script
await script_obj.async_run(msg.get("variables"), context=context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1513, in async_run
await asyncio.shield(run.async_run())
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 405, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 449, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 472, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step
await service_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/config/custom_components/alexa_media/helpers.py", line 156, in _catch_login_errors
result = await func(*args, **kwargs)
File "/config/custom_components/alexa_media/services.py", line 113, in clear_history
await AlexaAPI.clear_history(login_obj, items)
File "/usr/local/lib/python3.10/site-packages/alexapy/helpers.py", line 141, in wrapper
return await func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/alexapy/alexaapi.py", line 1636, in clear_history
if response.status == 404:
AttributeError: 'NoneType' object has no attribute 'status'