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

Detected blocking call to import_module inside the event loop by custom integration 'zha_toolkit' #224

Open
luke7101 opened this issue May 1, 2024 · 25 comments

Comments

@luke7101
Copy link

luke7101 commented May 1, 2024

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
@mdeweerd
Copy link
Owner

mdeweerd commented May 1, 2024

Thank you for reporting this.

It seems that HA now added a requirement to do imports inside a task.

home-assistant/core#116425 (comment)
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.

@luke7101
Copy link
Author

luke7101 commented May 2, 2024

I don't have the skills to do so, sorry...

@ChristBKK
Copy link

Yes same warning all day

@mdeweerd
Copy link
Owner

mdeweerd commented May 2, 2024

In the mean time, I think that the log level for homeassistant.util.loop] could be set to "error" to stop filling the logs.

@fbalesse
Copy link

fbalesse commented May 6, 2024

Same issue keep on Core v2024.5.1

@erkr
Copy link

erkr commented May 6, 2024

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.

@CordoWEB
Copy link

CordoWEB commented May 7, 2024

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 :)

@ChristBKK
Copy link

ChristBKK commented May 8, 2024

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.

@nathan-curtis
Copy link

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.

@CordoWEB
Copy link

CordoWEB commented May 8, 2024

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.

@nathan-curtis
Copy link

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.

@erkr
Copy link

erkr commented May 8, 2024

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.

@CordoWEB
Copy link

CordoWEB commented May 8, 2024

The subject of the topic "Detected blocking call to import_module inside the event loop by custom integration 'zha_toolkit'" is a bug.

@erkr
Copy link

erkr commented May 8, 2024

@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).

@CordoWEB
Copy link

Thanks a lot to @benschumacher for his work.
His patch work fine on 2024.5.x HAS 👍

@ChristBKK
Copy link

@mdeweerd can you push this update so it shows up via HACS?

@elupus
Copy link

elupus commented Jun 1, 2024

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

@CordoWEB
Copy link

CordoWEB commented Jun 1, 2024

Note. Next on need to be fixed too. Open calls of files.

You have this error when you call what service ?

@elupus
Copy link

elupus commented Jun 1, 2024

Just startup. (New warning in beta of home Assistant)

@CordoWEB
Copy link

CordoWEB commented Jun 1, 2024

I do not have this error with HAS 2024.5.x.
I have just apply the patch provided by @benschumacher and all work fine.

@elupus
Copy link

elupus commented Jun 1, 2024

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

@erkr
Copy link

erkr commented Jun 1, 2024

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

@CordoWEB
Copy link

CordoWEB commented Jun 1, 2024

@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
Copy link

elupus commented Jun 1, 2024

@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)

@CordoWEB
Copy link

CordoWEB commented Jun 2, 2024

@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.

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

8 participants