syssi / xiaomi_fan

Xiaomi Mi Smart Fan integration for Home Assistant
Apache License 2.0
431 stars 118 forks source link

AttributeError: type object 'FanEntityFeature' has no attribute 'TURN_OFF' #273

Closed saschachina closed 3 months ago

saschachina commented 3 months ago

After update to 2024.8.0.0 my fan became not available and i got following logs:

Logger: homeassistant Quelle: custom_components/xiaomi_miio_airpurifier/fan.py:1268 Integration: xiaomi_miio_airpurifier (Dokumentation, Probleme) Erstmals aufgetreten: 18:21:07 (38 Vorkommnisse) Zuletzt protokolliert: 18:39:37

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 1048, in _async_update_entity_states
    await entity.async_update_ha_state(True)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 962, in async_update_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1133, in _async_write_ha_state
    state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1063, in __async_calculate_state
    capability_attr = self.capability_attributes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 391, in capability_attributes
    supported_features = self.supported_features_compat
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 436, in supported_features_compat
    features = self.supported_features
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_miio_airpurifier/fan.py", line 1268, in supported_features
    | FanEntityFeature.TURN_OFF
      ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'FanEntityFeature' has no attribute 'TURN_OFF'

I double the check the IP address and the token, everything looks fine.

syssi commented 3 months ago

Which Home Assistant Core version do you use?

saschachina commented 3 months ago

Which Home Assistant Core version do you use?

2024.7.4

syssi commented 3 months ago

2024.8.1 is required.

syssi commented 3 months ago

I missed enforcing this requirement using the manifest.

saschachina commented 3 months ago

I missed enforcing this requirement using the manifest.

ok thanks for the information, then i will update to HA Core 2024.8.1

syssi commented 3 months ago

Please re-open the issue if it still doesn't work. :-)