-
-
Notifications
You must be signed in to change notification settings - Fork 566
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
Support of multiple zones for app_zoned_cleaning #311
Conversation
miio/vacuum.py
Outdated
) | ||
def zoned_clean(self, *zones): | ||
"""Cleans zoned areas. | ||
:enter one or multiple zones: [x1,y1,x2,y2, iterations],[x1,y1,x2,y2, iterations]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
miio/tests/test_vacuum.py
Outdated
def test_zoned_clean(self): | ||
self.device.start() | ||
assert self.status().is_on is True | ||
self.device.zoned_clean([25000, 25000, 25500, 25500, 3],[23000, 23000, 22500, 22500, 1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing whitespace after ','
miio/vacuum_cli.py
Outdated
"""Going to target.""" | ||
click.echo("Going to target : %s" % vac.goto()) | ||
|
||
@cli.command() |
There was a problem hiding this comment.
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
miio/vacuum_cli.py
Outdated
@@ -196,6 +196,17 @@ def home(vac: miio.Vacuum): | |||
"""Return home.""" | |||
click.echo("Requesting return to home: %s" % vac.home()) | |||
|
|||
@cli.command() |
There was a problem hiding this comment.
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
Do you still need help or does it work already? |
I couldn't test the changes, so I have no idea if this works. Also, I wasn't really sure how to setup the click.arguments, so somebody should have a look at these anyway. |
app_goto_target and app_zoned_clean
miio/vacuum.py
Outdated
return self.send("app_goto_target", | ||
[x_coord, y_coord]) | ||
|
||
@command( |
There was a problem hiding this comment.
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
miio/vacuum.py
Outdated
@@ -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( |
There was a problem hiding this comment.
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
miio/vacuum.py
Outdated
[x1_coord, y1_coord, x2_coord, y2_coord, iterations]) | ||
def zoned_clean(self, zones: List): | ||
"""Cleans zoned areas. | ||
:param List zones: List of zones to clean: [[x1,y1,x2,y2, iterations],[x1,y1,x2,y2, iterations]]""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (107 > 100 characters)
The vacuum only accepts zones within a list, so even a single list has to be passed like this:
[[x1,y1,x2,y2, iterations]]
The current code only sends "[x1,y1,x2,y2, iterations]" to the vacuum, so it does not work. I tried to change the code so that it accepts multiple zones, but I am not sure if it works like this. In addition, I have no no idea how to define the click.argument for a list. So I definitely going to need help on this one.