-
Notifications
You must be signed in to change notification settings - Fork 258
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
fix: adapt new ha constants #635
base: master
Are you sure you want to change the base?
Conversation
Tested in my 2025.1 HA environment, works perfectly without error log outputs and fixes the deprecation Thanks vergil! |
I'm sorry for n00b question, but how do i import these fixes ? EDIT: nvm, i have found out, sry ;-) |
Thanks for the quick help, it works great! :) |
Thanks Virgil for this quick fix. |
Here are a few short instructions on how to apply these changes to your HA before this repo's owner merge this PR.
git clone https://github.com/vergil-zhao/midea_ac_lan.git
cp -r midea_ac_lan/custom_components/midea_ac_lan config/custom_components/
|
This is great, although the instructions are a little different for those running HA Core in Docker... Just need to preceed the commands with sudo and adjust the paths. Also, |
Thanks, just updated the comment. |
Hi, thanks a lot Vergil, is working perfectely. very good job. thanks. |
Thanks for this PR.. what about the following errors that get logged as well.. Logger: homeassistant.helpers.frame Detected code that calls async_forward_entry_setup for integration midea_ac_lan with title: Dehumidifier and entry_id: f0931c97c4092c8bc1715d34c685e994, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1, please report this issue Detected that custom integration 'midea_ac_lan' calls async_forward_entry_setup for integration, midea_ac_lan with title: Dehumidifier and entry_id: f0931c97c4092c8bc1715d34c685e994, which is deprecated, await async_forward_entry_setups instead at custom_components/midea_ac_lan/init.py, line 171: hass.async_create_task(hass.config_entries.async_forward_entry_setup(. This will stop working in Home Assistant 2025.6, please create a bug report at https://github.com/georgezhao2010/midea_ac_lan/issues Plus a bunch of these… COLOR_MODE_WHITE was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2026.1. Use ColorMode.WHITE instead, please report it to the author of the 'midea_ac_lan' custom integration And finally.. Detected blocking call to import_module with args ('.a1.device', 'custom_components.midea_ac_lan.midea.devices') inside the event loop by custom integration 'midea_ac_lan' at custom_components/midea_ac_lan/midea/devices/init.py, line 23: module = import_module(device_path, package) (offender: /config/custom_components/midea_ac_lan/midea/devices/init.py, line 23: module = import_module(device_path, package)), please create a bug report at https://github.com/georgezhao2010/midea_ac_lan/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#import_module Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/main.py", line 227, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 213, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.13/asyncio/base_events.py", line 707, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 678, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2033, in _run_once handle._run() File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 461, in async_setup_component await asyncio.gather( File "/usr/src/homeassistant/homeassistant/setup.py", line 463, in create_eager_task( File "/usr/src/homeassistant/homeassistant/util/async.py", line 45, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 788, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/midea_ac_lan/init.py", line 148, in async_setup_entry device = device_selector( File "/config/custom_components/midea_ac_lan/midea/devices/init.py", line 23, in device_selector module = import_module(device_path, package) |
Hi, it didn't work for me. I copied the 3 files directly into the box, overwritten the original files. I am on version v0.3.22. This is what I am getting:
|
I think I understand the problem: this change is based on the version on master, not the last released version. Copying the files will not work as they are based on changes that have not been released with v0.3.22 (this change is the one is the one causing the error, not sure if fixing this one will fix everything). Manually editing the files on your local version will work, though. edit: I've now checked out master, copied the files over, and now it works. So don't copy the files over if you have the latest released version. |
This reporistory is dead because the maintainer has not been available for a long time and no more pull requests are being merged. You should switch to https://github.com/wuwentao/midea_ac_lan. |
This worked a treat! Thank you. |
work 100% Thanks !!!! |
Tested this as well, and works. Even better. With georgezhao2010-s version HA gave me some notification, that in a future version (2025.04?) this implementation will no longer work. |
It worked perfectly for me! Thank you |
Thank you, followed the instructions above & it fixed mine. |
Fix all related deprecated constants
#631 #632 #633 #634