You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue: in miio/airpurifier.py you define the air purifier modes as:
class OperationMode(enum.Enum):
# Supported modes of the Air Purifier Pro, 2, V3
Auto = "auto"
Silent = "silent"
Favorite = "favorite"
# Additional supported modes of the Air Purifier 2 and V3
Idle = "idle"
# Additional supported modes of the Air Purifier V3
Medium = "medium"
High = "high"
Strong = "strong"
As result, when a script does a string comparison, they don't match due to capitalisation.
I am really no expert coder, so I ask you straightforward: since capitalised it looks nicer, would it make sense to modify your library to introduce capitals? Yes/no and why?
I can submit a pull request (I think that's the name) with the edit, if you pre-approve the idea.
The text was updated successfully, but these errors were encountered:
So, the enum values are the real values the device is reporting, so we cannot change those in this library. After checking the homeassistant's code, the cause for the problem is visible here: https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_miio/fan.py#L814 - where it tries to acquire the enum member using the value instead of the key, which is not possible.
The proper way to fix this would be to modify the homeassistant platform to store not just the name but the enums themselves in the _speedlist, and then access either value or name whichever is relevant.
Issue: in miio/airpurifier.py you define the air purifier modes as:
Home Assistant depends on your library and in https://github.com/home-assistant/core/blob/dev/homeassistant/components/xiaomi_miio/fan.py they define the modes as:
As result, when a script does a string comparison, they don't match due to capitalisation.
I am really no expert coder, so I ask you straightforward: since capitalised it looks nicer, would it make sense to modify your library to introduce capitals? Yes/no and why?
I can submit a pull request (I think that's the name) with the edit, if you pre-approve the idea.
The text was updated successfully, but these errors were encountered: