mill1000 / midea-ac-py

Home Assistant custom integration to control Midea (and associated brands) air conditioners via LAN.
MIT License
154 stars 16 forks source link

2024.9.0 - AttributeError: 'MideaClimateACDevice' object has no attribute '_swing_modes'. #226

Closed bkoerbel closed 2 months ago

bkoerbel commented 2 months ago

Works as expected in 2024.8.1

After upgrade to 2024.9.0, the climate entity for the device disappears with following message: This entity is no longer being provided by the midea_ac integration. If the entity is no longer in use, delete it in settings. All other device entities seem to still exist, but the climate entity has disappeared.

Attached logs of upgrade from 2024.8.1 to 2024.9.0: home-assistant_midea_ac_2024-09-04T01-52-20.547Z.log

Attached debug log of 2024.9.0 integration setup: home-assistant_midea_ac_2024-09-04T01-40-20.522Z.log Seems like this might be the relevant error: AttributeError: 'MideaClimateACDevice' object has no attribute '_swing_modes'. Did you mean: 'swing_modes'?

CRCinAU commented 2 months ago

I get the same error on another A/C unit:

AttributeError: 'MideaClimateACDevice' object has no attribute '_swing_modes'. Did you mean: 'swing_modes'?
2024-09-04 12:37:24.170 ERROR (MainThread) [homeassistant.components.climate] Error while setting up midea_ac platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 364, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/midea_ac/climate.py", line 62, in async_setup_entry
    MideaClimateACDevice(hass, coordinator, config_entry.options)
  File "/config/custom_components/midea_ac/climate.py", line 174, in __init__
    _LOGGER.debug("Supported swing modes: '%s'.", self._swing_modes)
                                                  ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 323, in __getattribute__
    return super().__getattribute__(__name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MideaClimateACDevice' object has no attribute '_swing_modes'. Did you mean: 'swing_modes'?
2024-09-04 12:37:36.570 WARNING (MainThread) [msmart.device.AC.device] Device is not capable of display control.
alexmarsaudon commented 2 months ago

Just chiming in to +1 this. Same errors as the two users above on a Midea (rebranded Danby). image

mill1000 commented 2 months ago

Should be fixed by 2024.9.1

CRCinAU commented 2 months ago

Can confirm. 2024.9.1 does seem to function again.

Thanks for the quick fix :)

alexmarsaudon commented 2 months ago

^Same, Thanks for the insanely quick turnaround on this!