Skip to content

RuntimeError: Detected that custom integration 'hass_agent' calls async_create_task from a thread  #31

@kbirger

Description

@kbirger

I'm seeing repeated errors from home assistant that indicate that this integration is calling async_create_task from a thread. I think this is related to an update of home assistant. The result is that some functionality, such as notifying the windows app does not work.

2024-05-06 17:27:15.644 WARNING (SyncWorker_49) [homeassistant.helpers.frame] Detected that custom integration 'hass_agent' calls async_create_task from a thread at custom_components/hass_agent/__init__.py, line 147: hass.async_create_task(handle_apis_changed(hass, entry, apis)), please report it to the author of the 'hass_agent' custom integration
2024-05-06 17:27:15.647 ERROR (SyncWorker_49) [homeassistant.util.logging] Exception in updated when handling msg on 'hass.agent/devices/XXXXX': '{"serial_number":XXXX","device":{"identifiers":"hass.agent-XXXX","manufacturer":"LAB02 Research","model":"Microsoft Windows NT 10.0.22631.0","name":"XXXX","sw_version":"2022.14.0"},"apis":{"notifications":true,"media_player":true}}'
Traceback (most recent call last):
  File "/config/custom_components/hass_agent/__init__.py", line 147, in updated
    hass.async_create_task(handle_apis_changed(hass, entry, apis))
  File "/usr/src/homeassistant/homeassistant/core.py", line 816, in async_create_task
    self.verify_event_loop_thread("async_create_task")
  File "/usr/src/homeassistant/homeassistant/core.py", line 440, in verify_event_loop_thread
    frame.report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 162, in report
    _report_integration(what, integration_frame, level, error_if_integration)
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 203, in _report_integration
    raise RuntimeError(
RuntimeError: Detected that custom integration 'hass_agent' calls async_create_task from a thread at custom_components/hass_agent/__init__.py, line 147: hass.async_create_task(handle_apis_changed(hass, entry, apis)). Please report it to the author of the 'hass_agent' custom integration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions