From e5b5fc1b629e6eff23aa9d0fbb2b578e3632ce76 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 29 Jun 2019 21:14:14 +0200 Subject: [PATCH 1/2] Extend discovery --- miio/discovery.py | 1 + 1 file changed, 1 insertion(+) diff --git a/miio/discovery.py b/miio/discovery.py index f709d9707..9514f30e6 100644 --- a/miio/discovery.py +++ b/miio/discovery.py @@ -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), From 376c59518848eddbb47c6a0550b691e10855f9fa Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 29 Jun 2019 21:26:43 +0200 Subject: [PATCH 2/2] Initial draft of the segment cleaning --- miio/vacuum.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/miio/vacuum.py b/miio/vacuum.py index b28be8c2d..17e301357 100644 --- a/miio/vacuum.py +++ b/miio/vacuum.py @@ -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):