-
-
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
Added new commands app_goto_target and app_zoned_clean #310
Conversation
Added new app_goto_target command
miio/vacuum.py
Outdated
click.argument("y2_coord", type=int), | ||
click.argument("iterations", type=int), | ||
) | ||
def zoned_clean(self, x_coord: int, y_coord: int, x2_coord: int, y2_coord: int, iterations: int): |
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 (101 > 100 characters)
miio/vacuum.py
Outdated
:param int y_coord: y coordinate""" | ||
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.
expected 1 blank line, found 0
miio/vacuum.py
Outdated
@@ -72,6 +72,33 @@ def home(self): | |||
"""Stop cleaning and return home.""" | |||
self.send("app_stop") | |||
return self.send("app_charge") | |||
|
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.
blank line contains whitespace
Yeah, I'm newbie sorry :P |
No problem! Just change/update the code lines with complains and commit. |
miio/vacuum.py
Outdated
click.argument("y2_coord", type=int), | ||
click.argument("iterations", type=int), | ||
) | ||
def zoned_clean(self, x_coord: int, y_coord: int, |
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/vacuum.py
Outdated
:param int y_coord: y coordinate""" | ||
return self.send("app_goto_target", | ||
[x_coord, y_coord]) | ||
|
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.
blank line contains whitespace
I hope I understood and did this correctly.
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) |
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/tests/test_vacuum.py
Outdated
def test_goto(self): | ||
self.device.start() | ||
assert self.status().is_on is True | ||
self.device.goto(24000,24000) |
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 ','
Looks great, thanks a lot! 👍 🥇 Maybe it's possible to give a list of lists for multiple zones, but that can be added also later on. |
It's not only possible, but in fact necessary. The vacuum only accepts zones within a list, so even a single list has to be passed like this:
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. I'll open a pull request, but definitely going to need help on this one. |
In theory, app_zoned_clean should be able to take multiple zones at once - but I do not know how to implement this.