Skip to content

Fixed async call on 2024.5.0#65

Open
jolcese wants to merge 1 commit intosebirdman:masterfrom
jolcese:fix_ha2024.5.0
Open

Fixed async call on 2024.5.0#65
jolcese wants to merge 1 commit intosebirdman:masterfrom
jolcese:fix_ha2024.5.0

Conversation

@jolcese
Copy link
Copy Markdown

@jolcese jolcese commented May 25, 2024

No description provided.

@njobrien1006
Copy link
Copy Markdown
Contributor

I don't believe this is correct. All of the PAHO.MQTT functions are SYNC and handled via an independent thread and not the ASYNC.loop.

Can you elaborate on what led you to this change?

@mtnolan
Copy link
Copy Markdown

mtnolan commented Jun 8, 2024

Confirmed this resolves breaking change.

@njobrien1006
Copy link
Copy Markdown
Contributor

Out of curiosity, I reloaded this integration to get/see the error:

2024-06-09 10:32:45.970 WARNING (Thread-2 (_mqtt_connect_func)) [homeassistant.helpers.frame] Detected that custom integration 'traeger' calls async_create_task from a thread at custom_components/traeger/traeger.py, line 230: self.hass.async_create_task(self.update_state(grill_id)), please report it to the author of the 'traeger' custom integration
2024-06-09 10:32:45.971 ERROR (Thread-2 (_mqtt_connect_func)) [custom_components.traeger] Caught exception in on_subscribe: Detected that custom integration 'traeger' calls async_create_task from a thread at custom_components/traeger/traeger.py, line 230: self.hass.async_create_task(self.update_state(grill_id)). Please report it to the author of the 'traeger' custom integration.
2024-06-09 10:32:45.972 ERROR (Thread-2 (_mqtt_connect_func)) [root] Uncaught thread exception

The error is actually @ Line 230.

That error is actually in relationship to async_create_task being called from a thread. See additional fix details here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants