Skip to content

Commit

Permalink
viomi: add ability to change the mopping pattern (#744)
Browse files Browse the repository at this point in the history
* mop_mode command allows now changing between S and Y patterns
* old mop_mode command has been renamed to clean_mode which is more suitable name

Fixes #725
  • Loading branch information
rytilahti committed Jul 3, 2020
1 parent 02e574d commit 0c541aa
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions miio/viomivacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ class ViomiWaterGrade(Enum):
High = 13


class ViomiMopMode(Enum):
"""Mopping pattern."""

S = 0
Y = 1


class ViomiVacuumStatus:
def __init__(self, data):
# ["run_state","mode","err_state","battary_life","box_type","mop_type","s_time","s_area",
Expand Down Expand Up @@ -293,10 +300,14 @@ def move(self, direction, duration=0.5):
self.send("set_direction", [ViomiMovementDirection.Stop.value])

@command(click.argument("mode", type=EnumType(ViomiMode, False)))
def mop_mode(self, mode):
"""Set mopping mode."""
def clean_mode(self, mode):
"""Set the cleaning mode."""
self.send("set_mop", [mode.value])

@command(click.argument("mop_mode", type=EnumType(ViomiMopMode, False)))
def mop_mode(self, mop_mode):
self.send("set_moproute", [mop_mode.value])

@command()
def dnd_status(self):
"""Returns do-not-disturb status."""
Expand Down

0 comments on commit 0c541aa

Please sign in to comment.