Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 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
2 changes: 1 addition & 1 deletion miio/tests/test_vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_goto(self):
def test_zoned_clean(self):
self.device.start()
assert self.status().is_on is True
self.device.zoned_clean(25000, 25000, 25500, 25500, 3)
self.device.zoned_clean([[25000, 25000, 25500, 25500, 3], [23000, 23000, 22500, 22500, 1]])
assert self.status().state_code == self.device.STATE_ZONED_CLEAN

@pytest.mark.xfail
Expand Down
27 changes: 25 additions & 2 deletions miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def goto(self, x_coord: int, y_coord: int):
"""Go to specific target.
:param int x_coord: x coordinate
:param int y_coord: y coordinate"""
return self.send("app_goto_target",
[x_coord, y_coord])
return self.send("app_goto_target", [x_coord, y_coord])

@command(
click.argument("x1_coord", type=int),
Expand All @@ -102,6 +101,30 @@ def zoned_clean(self, x1_coord: int, y1_coord: int,
return self.send("app_zoned_clean",
[x1_coord, y1_coord, x2_coord, y2_coord, iterations])

@command(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redefinition of unused 'goto' from line 76

click.argument("x_coord", type=int),
click.argument("y_coord", type=int),
)
def goto(self, x_coord: int, y_coord: int):
"""Go to specific target.
:param int x_coord: x coordinate
:param int y_coord: y coordinate"""
return self.send("app_goto_target",
[x_coord, y_coord])

@command(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redefinition of unused 'zoned_clean' from line 86

click.argument("zones"),
)
def zoned_clean(self, zones: List):
"""Cleans zoned areas.
:Enter a list of zones to clean: [[x1,y1,x2,y2, iterations],[x1,y1,x2,y2, iterations]]
:param int x1: x1 coordinate bottom left corner
:param int y1: y1 coordinate bottom left corner
:param int x2: x2 coordinate top right corner
:param int y2: y2 coordinate top right corner
:param int iterations: How many times the zone should be cleaned"""
return self.send("app_zoned_clean", zones)

@command()
def manual_start(self):
"""Start manual control mode."""
Expand Down
13 changes: 13 additions & 0 deletions miio/vacuum_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ def home(vac: miio.Vacuum):
click.echo("Requesting return to home: %s" % vac.home())


@cli.command()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

@pass_dev
def goto(vac: miio.Vacuum):
"""Going to target."""
click.echo("Going to target : %s" % vac.goto())


@cli.command()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected 2 blank lines, found 1

@pass_dev
def zoned_clean(vac: miio.Vacuum):
"""Cleaning zone(s)."""
click.echo("Cleaning zone(s) : %s" % vac.zoned_clean())

@cli.group()
@pass_dev
# @click.argument('command', required=False)
Expand Down