alandtse / alexa_media_player

This is a custom component to allow control of Amazon Alexa devices in Home Assistant using the unofficial Alexa API.
Apache License 2.0
1.46k stars 282 forks source link

'alexa_media' calls hass.bus.async_fire from a thread other than the event loop #2284

Closed jdeath closed 3 months ago

jdeath commented 3 months ago

IMPORTANT: Please search the issues, including closed issues, and the FAQ before opening a new issue. The template is mandatory; failure to use it will result in issue closure.

Describe the bug

'alexa_media' calls hass.bus.async_fire from a thread other than the event loop

To Reproduce

Just restart home assistant

Expected behavior

Screenshots

System details

Logs

File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/alexa_media/sensor.py", line 433, in _trigger_event
self.hass.bus.async_fire(
File "/usr/src/homeassistant/homeassistant/core.py", line 1500, in async_fire
self._hass.verify_event_loop_thread("hass.bus.async_fire")
File "/usr/src/homeassistant/homeassistant/core.py", line 447, in verify_event_loop_thread
frame.report(
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 159, in report
_report_integration(what, integration_frame, level, error_if_integration)
File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 197, in _report_integration
raise RuntimeError(
RuntimeError: Detected that custom integration 'alexa_media' calls hass.bus.async_fire from a thread other than the event loop, which may cause Home Assistant to crash or data to corrupt. For more information, see https://developers.home-assistant.io/docs/asyncio_thread_safety/#hassbusasync_fire at custom_components/alexa_media/sensor.py, line 433: self.hass.bus.async_fire(. Please report it to the author of the 'alexa_media' custom integration.

Additional context

jdeath commented 3 months ago

same as #2264

closed