HomeAssistant-Mods / home-assistant-miele

Miele integration for Home assistant
141 stars 30 forks source link

Several warning after upgrade to HA 2024.5 #173

Open Vanni76 opened 5 months ago

Vanni76 commented 5 months ago

HA log file has this message every 2 seconds:

WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module inside the event loop by custom integration 'miele' at custom_components/miele/init.py, line 454: platform = import_module(".{}".format(component), name) (offender: /config/custom_components/miele/init.py, line 454: platform = import_module(".{}".format(component), name)), please create a bug report at https://github.com/HomeAssistant-Mods/home-assistant-miele/issues

Any idea how to fix it? Thanks

akmail commented 4 months ago

the maintainer of this integration seems to need very long for fixing bugs. So long, to supress such warnings from the logs, you can add following to your configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.util.loop: critical
Vanni76 commented 4 months ago

Thanks akmail, I implement the log as you suggested and now I'm able to use the integration again!

akmail commented 4 months ago

I'm not a python developer at all, but looks like the fix might be easy according to: https://community.home-assistant.io/t/how-to-call-importlib-import-module-in-a-way-that-doesnt-block-the-thread/728021

the fix in the line 454 would be something like this:

wait hass.async_add_executor_job(
        loadModules, const.MODULE_DIR
)

if someone could put that fix in please? I doubt I could ramp up with my python knowledge in an acceptable speed. Neither I know how the integration works / how to build / test / pubish etc.

so thanks in advance to the developers maintaing this.

akmail commented 4 months ago

Meross LAN integration has already provided a fix for the same issue. If the maintainer wants to check how other developers seem to fix it ... thanks! I've also noticed that Miele integration uses deprecated functionality that will stop working in 2025. Is anyone aware of that? There is not much communication here...

akmail commented 4 months ago

in the upcoming release, five other integrations have fixed this... I wish Miele integration was more active...

akmail commented 4 months ago

I guess it was hard to find out. but apparently this integration is not being updated anymore, instead there is a new standard integration in HACS, that is called "Miele" - https://github.com/astrandb/miele it has fixed the issue here and seems to work fine. unfortunately, Miele is doing their server maintenance until 6th of June (6 days Maintanace for a cloud solution, wow guys - you can still impress me, but why not, the money is already paid, isnt't it?)

anyway. for a couple of minutes it seemed to work.

but to be honest I find it it a bit hard to be up-to-date about this topic. how can I figure out that an integration is outdated and had been replaced by another one?

also, to confuse a bit more, there seem to be tons on other forks from the miele integration, most of them are very active. what does it mean? I'm not sure really.