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

Added new commands app_goto_target and app_zoned_clean #310

Merged
merged 11 commits into from
Apr 18, 2018

Conversation

ciB89
Copy link
Contributor

@ciB89 ciB89 commented Apr 16, 2018

In theory, app_zoned_clean should be able to take multiple zones at once - but I do not know how to implement this.

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):

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(

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")

Choose a reason for hiding this comment

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

blank line contains whitespace

@ciB89
Copy link
Contributor Author

ciB89 commented Apr 16, 2018

Yeah, I'm newbie sorry :P

@coveralls
Copy link

coveralls commented Apr 16, 2018

Coverage Status

Coverage increased (+0.1%) to 73.113% when pulling dd76ada on ciB89:master into 476aadc on rytilahti:master.

@syssi
Copy link
Collaborator

syssi commented Apr 17, 2018

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,

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])

Choose a reason for hiding this comment

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

blank line contains whitespace

def test_zoned_clean(self):
self.device.start()
assert self.status().is_on is True
self.device.zoned_clean(25000,25000,25500,25500,3)

Choose a reason for hiding this comment

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

missing whitespace after ','

def test_goto(self):
self.device.start()
assert self.status().is_on is True
self.device.goto(24000,24000)

Choose a reason for hiding this comment

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

missing whitespace after ','

@rytilahti
Copy link
Owner

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.

@rytilahti rytilahti merged commit 76a2dd2 into rytilahti:master Apr 18, 2018
@ciB89
Copy link
Contributor Author

ciB89 commented Apr 23, 2018

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:

[[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. I'll open a pull request, but definitely going to need help on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants