midea_ac_lan
midea_ac_lan copied to clipboard
fix: adapt new ha constants
Fix all related deprecated constants
#631 #632 #633 #634
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. Works perfect again.
Fix all related deprecated constants
#631 #632 #633 #634
Could you help me with more details. I don't know what I should do. thank you
Here are a few short instructions on how to apply these changes to your HA before this repo's owner merge this PR. Note: this may only work on HAOS
- You must install the Terminal add-on in your HA, then follow the commands below.
git clone https://github.com/vergil-zhao/midea_ac_lan.git
cp -r midea_ac_lan/custom_components/midea_ac_lan config/custom_components/
- Restart your HA
Here are a few short instructions on how to apply these changes to your HA before this repo's owner merge this PR.
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, copy is not a native command, cp should be used instead.
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,
copyis not a native command,cpshould be used instead.
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 Source: helpers/frame.py:234 First occurred: 10:06:33 PM (11 occurrences) Last logged: 10:06:33 PM
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 ATTR_COLOR_TEMP was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2026.1. Use kelvin equivalent (ATTR_COLOR_TEMP_KELVIN) instead, please report it to the author of the 'midea_ac_lan' custom integration ATTR_KELVIN was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2026.1. Use ATTR_COLOR_TEMP_KELVIN instead, please report it to the author of the 'midea_ac_lan' custom integration ATTR_MIN_MIREDS was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2026.1. Use kelvin equivalent (ATTR_MAX_COLOR_TEMP_KELVIN) instead, please report it to the author of the 'midea_ac_lan' custom integration ATTR_MAX_MIREDS was used from midea_ac_lan, this is a deprecated constant which will be removed in HA Core 2026.1. Use kelvin equivalent (ATTR_MIN_COLOR_TEMP_KELVIN) instead, please report it to the author of the 'midea_ac_lan' custom integration
And finally.. Logger: homeassistant.util.loop Source: util/loop.py:136 First occurred: 10:06:30 PM (1 occurrences) Last logged: 10:06:30 PM
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 "
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:
Logger: homeassistant.setup
Source: setup.py:334
First occurred: 10:24:32 (1 occurrences)
Last logged: 10:24:32
Setup failed for custom integration 'midea_ac_lan': Unable to import component: Exception importing custom_components.midea_ac_lan
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/config/custom_components/midea_ac_lan/__init__.py", line 17, in <module>
from .midea_devices import MIDEA_DEVICES
File "/config/custom_components/midea_ac_lan/midea_devices.py", line 997, in <module>
C3Attributes.status_dhw: {
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'DeviceAttributes' has no attribute 'status_dhw'. Did you mean: 'status_ibh'?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1015, in async_get_component
comp = await self.hass.async_add_import_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self._get_component, True
^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/loader.py", line 1086, in _get_component
raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.midea_ac_lan
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _get_component
ComponentProtocol, importlib.import_module(self.pkg_path)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
return func(*args, **kwargs)
File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/config/custom_components/midea_ac_lan/__init__.py", line 17, in <module>
from .midea_devices import MIDEA_DEVICES
File "/config/custom_components/midea_ac_lan/midea_devices.py", line 997, in <module>
C3Attributes.status_dhw: {
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'DeviceAttributes' has no attribute 'status_dhw'. Did you mean: 'status_ibh'?
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
component = await integration.async_get_component()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1035, in async_get_component
self._component_future.result()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
comp = self._get_component()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1086, in _get_component
raise ImportError(f"Exception importing {self.pkg_path}") from err
ImportError: Exception importing custom_components.midea_ac_lan
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.
Here are a few short instructions on how to apply these changes to your HA before this repo's owner merge this PR. Note: this may only work on HAOS
- You must install the Terminal add-on in your HA, then follow the commands below.
git clone https://github.com/vergil-zhao/midea_ac_lan.git cp -r midea_ac_lan/custom_components/midea_ac_lan config/custom_components/
- Restart your HA
This worked a treat!
Thank you.
Here are a few short instructions on how to apply these changes to your HA before this repo's owner merge this PR. Note: this may only work on HAOS
- You must install the Terminal add-on in your HA, then follow the commands below.
git clone https://github.com/vergil-zhao/midea_ac_lan.git cp -r midea_ac_lan/custom_components/midea_ac_lan config/custom_components/
- Restart your HA
work 100%
Thanks !!!!
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.
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. Recommend switching for everyone. Nevertheless, thanks for the fixes. (I'm still a noob at HA)
It worked perfectly for me! Thank you
Thank you, followed the instructions above & it fixed mine.