Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider making _async_update_data a normal async callback #456

Open
bdraco opened this issue Feb 5, 2025 · 0 comments
Open

Consider making _async_update_data a normal async callback #456

bdraco opened this issue Feb 5, 2025 · 0 comments

Comments

@bdraco
Copy link

bdraco commented Feb 5, 2025

self.hass.add_job(self._async_update_data())

self.hass.add_job(self._async_update_data())

Then you can call it directly instead of creating tasks

Note that add_job is the sync API intended to be used in other threads and shouldn't be called from the main thread. If you must call a coro from the main thread, use hass.async_create_task

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

No branches or pull requests

1 participant