zha-toolkit
zha-toolkit copied to clipboard
Detected blocking call to import_module inside the event loop by custom integration 'zha_toolkit'
Core v2024.5.0 Every call to zha_toolkit generates this error:
[homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'zha_toolkit' at custom_components/zha_toolkit/default.py, line 33: m = importlib.import_module(f".{module_name}", package=package_name) (offender: /config/custom_components/zha_toolkit/default.py, line 33: m = importlib.import_module(f".{module_name}", package=package_name)), please create a bug report at https://github.com/mdeweerd/zha-toolkit/issues
Thank you for reporting this.
It seems that HA now added a requirement to do imports inside a task.
https://github.com/home-assistant/core/issues/116425#issuecomment-2085697174 https://github.com/frenck/spook/pull/722/files
I have other priorities to handle. If somebody wants to fix and and propose a PR, that'ld be welcome.
I don't have the skills to do so, sorry...
Yes same warning all day
In the mean time, I think that the log level for homeassistant.util.loop] could be set to "error" to stop filling the logs.
Same issue keep on Core v2024.5.1
If somebody wants to fix and and propose a PR, that'ld be welcome.
I would love to help but haven't the required knowledge.
I have other priorities to handle. If somebody wants to fix and and propose a PR, that'ld be welcome.
Can we still hope for a new version in the coming weeks? If I could have helped you, I would have :)
I have other priorities to handle. If somebody wants to fix and and propose a PR, that'ld be welcome.
Can we still hope for a new version in the coming weeks? If I could have helped you, I would have :)
What I don't get considering how important this tool is for some ZHA integrations. Why is ZHA not taking this tool and integrating it into the ZHA main repo. Any reasons they don't?
This tool is a great addition to make ZHA even better.
So the ZHA owners could maintain it?
But yeah maybe there is a reason for that and I don't understand that.
It's a custom integration. HA core Devs generally don't adopt custom integrations like that. Instead the author elects it for inclusion if they wish to. But realize that adds extra requirements to the Devs time and many custom integration authors generally aren't interested.
If the author has no intention to do so - HA won't add extra work for themselves... They're already manpower constrained.
It's a custom integration. HA core Devs generally don't adopt custom integrations like that. Instead the author elects it for inclusion if they wish to. But realize that adds extra requirements to the Devs time and many custom integration authors generally aren't interested.
The big problem is that the ZHA integration is missing functionality like reading in entity "not exposed" Cluster / Attribute.
Then open a bug against zha to get the. To add the functionality. Slurping up a custom integration isn't how functions get tagged to HA.
Then open a bug against zha to get the. To add the functionality. Slurping up a custom integration isn't how functions get tagged to HA.
No for additions it's a feature requests, not a bug.
The subject of the topic "Detected blocking call to import_module inside the event loop by custom integration 'zha_toolkit'" is a bug.
@CordoWEB my reply was on having ZHA toolkit functions added to ZHA, that is a feature request. This issue is deprecation. Little harsh to call it a bug, but you are right (it's more maintenance).
Thanks a lot to @benschumacher for his work. His patch work fine on 2024.5.x HAS 👍
@mdeweerd can you push this update so it shows up via HACS?
Note. Next on need to be fixed too. Open calls of files.
[homeassistant.util.loop] Detected blocking call to open inside the event loop by custom integration 'zha_toolkit' at custom_components/zha_toolkit/utils.py, line 84: with open(fname, encoding="utf_8") as infile: (offender: /config/custom_components/zha_toolkit/utils.py, line 84: with open(fname, encoding="utf_8") as infile:), please create a bug report at https://github.com/mdeweerd/zha-toolkit/issues
Note. Next on need to be fixed too. Open calls of files.
You have this error when you call what service ?
Just startup. (New warning in beta of home Assistant)
I do not have this error with HAS 2024.5.x. I have just apply the patch provided by @benschumacher and all work fine.
I do not have this error with HAS 2024.5.x. I have just apply the patch provided by @benschumacher and all work fine.
Its in 2024.6.0 beta
I do not have this error with HAS 2024.5.x. I have just apply the patch provided by @benschumacher and all work fine.
Its in 2024.6.0 beta
@elupus Please don't add new issues into this one. Make a new issue please.
I guess this issue won't be fixed in core, it requires a new toolkit version with the patch as provided by
@benschumacher
@elupus : When you'll add your new issue, could you make the same test when HA 2024.6.0 final version will be available ?
@elupus : When you'll add your new issue, could you make the same test when HA 2024.6.0 final version will be available ?
Probably not. I dont use the integration anymore. So ive disabled it. Just wanted to give a heads up . The warning will guaranteed remain in final version (im part of ha member team)
@mdeweerd Where are you ? We need you ! @mdeweerd Où es tu ? Nous avons besoin de toi ! Nous pouvons t'aider mais il faut nous guider. Rien de grave j'espère.
Thanks a lot to @benschumacher for his work. His patch work fine on 2024.5.x HAS 👍
Sorry for being such a noob, i am not a developer and do not have any coding knowledge i just have an urgent need to get the zha toolkit working again so that i can "cast tuya magic spell" on a deivce. can you please guide me on how to apply this patch?
I have been busy and could only start spending some time now on this. I've integrated some fixes in the release and I think this issue is now solved.