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

Expose dnd status, add actions for viomivacuum #1603

Merged
merged 1 commit into from
Nov 23, 2022
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
7 changes: 6 additions & 1 deletion miio/integrations/vacuum/viomi/viomivacuum.py
Original file line number Diff line number Diff line change
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])