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

Add preliminary Roborock M1S / Mi Robot S1 support #526

Merged
merged 2 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions miio/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
DEVICE_MAP = {
"rockrobo-vacuum-v1": Vacuum,
"roborock-vacuum-s5": Vacuum,
"roborock-vacuum-m1s": Vacuum,
"chuangmi-plug-m1": partial(ChuangmiPlug, model=MODEL_CHUANGMI_PLUG_M1),
"chuangmi-plug-m3": partial(ChuangmiPlug, model=MODEL_CHUANGMI_PLUG_M3),
"chuangmi-plug-v1": partial(ChuangmiPlug, model=MODEL_CHUANGMI_PLUG_V1),
Expand Down
45 changes: 45 additions & 0 deletions miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,51 @@ def set_carpet_mode(self, enabled: bool, stall_time: int = 10,
}
return self.send("set_carpet_mode", [data])[0] == 'ok'

@command()
def stop_zoned_clean(self):
"""Stop cleaning a zone."""
return self.send("stop_zoned_clean")

@command()
def stop_segment_clean(self):
"""Stop cleaning a segment."""
return self.send("stop_segment_clean")

@command()
def resume_segment_clean(self):
"""Resuming cleaning a segment."""
return self.send("resume_segment_clean")

@command(
click.argument("segments", type=LiteralParamType(), required=True),
)
def segment_clean(self, segments: List):
"""Clean segments.
:param List segments: List of segments to clean: [16,17,18]"""
return self.send("app_segment_clean", segments)

@command()
def get_room_mapping(self):
"""Retrieves a list of segments."""
return self.send("get_room_mapping")

@command()
def get_segment_status(self):
"""Get the status of a segment."""
return self.send("get_segment_status")

def name_segment(self):
raise NotImplementedError("unknown parameters")
# return self.send("name_segment")

def merge_segment(self):
raise NotImplementedError("unknown parameters")
# return self.send("merge_segment")

def split_segment(self):
raise NotImplementedError("unknown parameters")
# return self.send("split_segment")

@classmethod
def get_device_group(cls):

Expand Down