homeassistant-midea-air-appliances-lan: Integration stopped working with 2024.1

Version of the custom_component

v0.8.13

Logs


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1277, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 181, in async_added_to_hass
    self.on_online(True)
  File "/config/custom_components/midea_dehumidifier_lan/humidifier.py", line 97, in on_online
    super().on_online(update)
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 238, in on_online
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1001, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/humidifier/__init__.py", line 217, in state_attributes
    if HumidifierEntityFeature.MODES in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable

Describe the bug

Dehumidifier is unavailable after the update. Already restartet the appliance, reloaded the integration and restarted HA wihtout success.

Debug log


Add your logs here.

```2024-01-03 22:47:21.513 DEBUG (MainThread) [custom_components.midea_dehumidifier_lan.hub] Created coordinator for {'api_version': 3, 'id': '14623504656****', 'ip_address': '192.168.179.96', 'name': 'Dehumidifier', 'token_key': '****************************************************************', 'token': '********************************************************************************************************************************', 'type': '0xa1', 'unique_id': '000000P0000000Q1C43960B5********', 'discovery': 'LAN'}
2024-01-03 22:47:21.769 DEBUG (MainThread) [custom_components.midea_dehumidifier_lan.appliance_coordinator] Finished fetching Dehumidifier data in 0.255 seconds (success: True)
2024-01-03 22:47:21.769 DEBUG (MainThread) [custom_components.midea_dehumidifier_lan.appliance_discovery] Starting periodic discovery with interval 15 minute(s), broadcast ['255.255.255.255'], configured []
2024-01-03 22:47:21.798 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_FAN_MODE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.FAN_MODE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.803 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_PRESET_MODE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.807 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_SWING_MODE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.SWING_MODE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.812 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_TARGET_TEMPERATURE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.816 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.821 WARNING (MainThread) [homeassistant.components.fan] SUPPORT_PRESET_MODE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.825 WARNING (MainThread) [homeassistant.components.fan] SUPPORT_PRESET_MODE was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use FanEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.829 WARNING (MainThread) [homeassistant.components.humidifier.const] SUPPORT_MODES was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use HumidifierEntityFeature.MODES instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.832 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues
2024-01-03 22:47:21.888 WARNING (MainThread) [homeassistant.components.light] Entity None (<class 'custom_components.cololight.light.coloLight'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <LightEntityFeature.EFFECT|17: 21> and color modes, please create a bug report at https://github.com/BazaJayGee66/homeassistant_cololight/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-01-03 22:47:22.098 WARNING (MainThread) [homeassistant.helpers.entity] Entity None (<class 'custom_components.midea_dehumidifier_lan.fan.DehumidiferFan'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <FanEntityFeature.PRESET_MODE: 8>, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-01-03 22:47:22.099 WARNING (MainThread) [homeassistant.helpers.entity] Entity None (<class 'custom_components.midea_dehumidifier_lan.humidifier.DehumidifierEntity'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <HumidifierEntityFeature.MODES: 1>, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation
2024-01-03 22:47:22.105 ERROR (MainThread) [homeassistant.components.humidifier] Error adding entities for domain humidifier with platform midea_dehumidifier_lan
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1277, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 181, in async_added_to_hass
    self.on_online(True)
  File "/config/custom_components/midea_dehumidifier_lan/humidifier.py", line 97, in on_online
    super().on_online(update)
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 238, in on_online
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1001, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/humidifier/__init__.py", line 217, in state_attributes
    if HumidifierEntityFeature.MODES in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable
2024-01-03 22:47:22.115 ERROR (MainThread) [homeassistant.components.humidifier] Error while setting up midea_dehumidifier_lan platform for humidifier
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 368, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 507, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 752, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1277, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 181, in async_added_to_hass
    self.on_online(True)
  File "/config/custom_components/midea_dehumidifier_lan/humidifier.py", line 97, in on_online
    super().on_online(update)
  File "/config/custom_components/midea_dehumidifier_lan/appliance_coordinator.py", line 238, in on_online
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 941, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1062, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1001, in __async_calculate_state
    attr.update(self.state_attributes or {})
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/humidifier/__init__.py", line 217, in state_attributes
    if HumidifierEntityFeature.MODES in self.supported_features:
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'int' is not iterable

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Reactions: 12
  • Comments: 35 (9 by maintainers)

Most upvoted comments

These deprecated constants are now unsupported from 2024.1: https://developers.home-assistant.io/blog/2022/04/02/support-constants-deprecation/

I’ve fixed the issue for my dehumidifier but not sure about other devices: https://github.com/drzoidberg33/homeassistant-midea-air-appliances-lan/commit/ea7fb21a9202b275e1dc20ce3be891153e5df2cf

These deprecated constants are now unsupported from 2024.1: https://developers.home-assistant.io/blog/2022/04/02/support-constants-deprecation/

I’ve fixed the issue for my dehumidifier but not sure about other devices: drzoidberg33@ea7fb21

You are the man! That fixed it for me. Thanks!

@drzoidberg33 how did you fix temporarily?

I just used the Studio Code addon and edited it directly for now, you’ll find the file under custom_components -> midea_dehumidifier_lan and check the changes in my commit above. Then restart HA.

Error - > None! Thank you, you are awesome!

Thanks @drzoidberg33 , do you know if this integrtiuon is still on mantenance, and this solution is only temporarily?

I stil not updated to 2024…1 and I don´t know if we will have a new integration version in the next dayss, or it will take a long time.

I’ll see if I get time to fix the other consts and submit a PR, I’m not sure if anyone is maintaining this repo anymore to merge the PR though.

Update of sensor.py

d0e7412

I tried the search on Vscode, i found temp_celsius on sensor.py

You right ! there is some constants in sensor.py that have to be updated too. I’ll updated it.

Hi All,

Same issue here. It works with those MR applied #132 and https://github.com/nbogojevic/midea-beautiful-air/pull/29 !

Please, release it 😉

#132 Remove most of the erros but still getting one more.

Logger: homeassistant.const
Source: helpers/deprecation.py:205
First occurred: 20:26:11 (2 occurrences)
Last logged: 20:26:11

TEMP_CELSIUS was used from midea_dehumidifier_lan, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/issues

I updated climate.py https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/pull/132/commits/6750b4c90636210f7dd03043490ee1acec50763b. with the new UnitOfTemperature.CELSIUS . Please test with the new one.

https://github.com/nbogojevic/homeassistant-midea-air-appliances-lan/pull/132 fixed the issue for me, my device was already configured

@drzoidberg33 how did you fix temporarily?

I just used the Studio Code addon and edited it directly for now, you’ll find the file under custom_components -> midea_dehumidifier_lan and check the changes in my commit above. Then restart HA.

Thank you.