Skip to content

air purifier unknown oprating mode #1106

Closed
@leonardpitzu

Description

@leonardpitzu

Describe the bug
Xiaomi Mi Air Purifier 3H reports None as operating mode which is not a valid operating mode and reported as such by Home Assistant (logs are full of it).

Version information (please complete the following information):

  • OS: Linux/Docker
  • python-miio: 0.5.6

Device information:
Xiaomi Mi Air Purifier 3H but this is not device specifiv

To Reproduce
Just use HA with a Xiaomi Air Purifier and the logs will fill up.

Expected behavior
A standard operating mode should be reported.

Console output
Update for fan.air_purifier fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 401, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 609, in async_device_update raise exc File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 931, in async_update { File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 932, in <dictcomp> key: self._extract_value_from_attribute(state, value) File "/usr/src/homeassistant/homeassistant/components/xiaomi_miio/fan.py", line 719, in _extract_value_from_attribute value = getattr(state, attribute) File "/usr/local/lib/python3.9/site-packages/miio/airpurifier_miot.py", line 113, in mode return OperationMode(self.data["mode"]) File "/usr/local/lib/python3.9/enum.py", line 360, in __call__ return cls.__new__(cls, value) File "/usr/local/lib/python3.9/enum.py", line 678, in __new__ raise ve_exc ValueError: None is not a valid OperationMode

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions