Skip to content

Commit

Permalink
Vacuum: add fan speed preset for gen1 firmwares 3.5.8+ (rytilahti#893)
Browse files Browse the repository at this point in the history
* Update vacuum.py for FW 3.5.8

Create a new class of fan speed for Firmware 3.5.8:
Silent = 38
Standard = 60
Turbo = 75
Max =100

* Update vacuum.py

* Fix linting

Co-authored-by: Teemu R <tpr@iki.fi>
  • Loading branch information
2 people authored and xvlady committed May 9, 2021
1 parent 350a551 commit b05ac2f
Showing 1 changed file with 10 additions and 1 deletion.
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 @@ -503,7 +510,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

0 comments on commit b05ac2f

Please sign in to comment.