Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vacuum: add fan speed preset for gen1 firmwares 3.5.8+ #893

Merged
merged 3 commits into from
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ class FanspeedV2(enum.Enum):
Gentle = 105


class FanspeedV3(enum.Enum):
Silent = 38
Standard = 60
Medium = 75
Turbo = 100


class FanspeedE2(enum.Enum):
# Original names from the app: Gentle, Silent, Standard, Strong, Max
Gentle = 41
Expand Down Expand Up @@ -501,7 +508,9 @@ def _autodetect_model(self):
fw_version = info.firmware_version
version, build = fw_version.split("_")
version = tuple(map(int, version.split(".")))
if version >= (3, 5, 7):
if version >= (3, 5, 8):
self._fanspeeds = FanspeedV3
elif version == (3, 5, 7):
self._fanspeeds = FanspeedV2
else:
self._fanspeeds = FanspeedV1
Expand Down