Skip to content

Commit

Permalink
Expose dnd status, add actions for viomivacuum (#1603)
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Nov 23, 2022
1 parent 3ea3e2c commit 1756fbc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion miio/integrations/vacuum/viomi/viomivacuum.py
Expand Up @@ -53,7 +53,7 @@

from miio.click_common import EnumType, command, format_output
from miio.device import Device
from miio.devicestatus import sensor, setting
from miio.devicestatus import action, sensor, setting
from miio.exceptions import DeviceException
from miio.integrations.vacuum.roborock.vacuumcontainers import (
ConsumableStatus,
Expand Down Expand Up @@ -725,6 +725,7 @@ def status(self) -> ViomiVacuumStatus:

status = ViomiVacuumStatus(defaultdict(lambda: None, zip(properties, values)))
status.embed(self.consumable_status())
status.embed(self.dnd_status())

return status

Expand All @@ -741,6 +742,7 @@ def set_power(self, on: bool):
return self.stop()

@command()
@action("Start cleaning")
def start(self):
"""Start cleaning."""
# params: [edge, 1, roomIds.length, *list_of_room_ids]
Expand Down Expand Up @@ -789,6 +791,7 @@ def start_with_room(self, rooms):
)

@command()
@action("Pause cleaning")
def pause(self):
"""Pause cleaning."""
# params: [edge_state, 0]
Expand All @@ -799,6 +802,7 @@ def pause(self):
self.send("set_mode", self._cache["edge_state"] + [2])

@command()
@action("Stop cleaning")
def stop(self):
"""Validate that Stop cleaning."""
# params: [edge_state, 0]
Expand Down Expand Up @@ -1103,6 +1107,7 @@ def carpet_mode(self, mode: ViomiCarpetTurbo):
return self.send("set_carpetturbo", [mode.value])

@command()
@action("Find robot")
def find(self):
"""Find the robot."""
return self.send("set_resetpos", [1])

0 comments on commit 1756fbc

Please sign in to comment.