frenck / spook

Spook 👻 Your homie
https://spook.boo
MIT License
360 stars 34 forks source link

Importing services does blocking I/O in the event loop #681

Closed bdraco closed 3 weeks ago

bdraco commented 1 month ago

What version of Spook are you using?

n/a

What version of Home Assistant are you using?

dev

The problem

https://github.com/frenck/spook/blob/6893c832c47b0ca26299edb4986fb0706f156881/custom_components/spook/services.py#L272

https://github.com/home-assistant/core/blob/3f545cb3d368a0ea046603e0120f42883187d02f/homeassistant/helpers/importlib.py#L27 could be used but there is no risk of something else loading the same code so loading it in the single default executor job is likely the simplest solution

Screenshot 2024-03-25 at 10 00 14 PM

Anything in the logs? Paste it here!

No response