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

Support of multiple zones for app_zoned_cleaning #311

Merged
merged 19 commits into from
Aug 21, 2018
Merged

Conversation

ciB89
Copy link
Contributor

@ciB89 ciB89 commented Apr 23, 2018

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.

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

Choose a reason for hiding this comment

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

trailing 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],[23000, 23000, 22500, 22500, 1])

Choose a reason for hiding this comment

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

missing whitespace after ','

@coveralls
Copy link

coveralls commented Apr 23, 2018

Coverage Status

Coverage remained the same at 70.619% when pulling b024c99 on ciB89:master into cc025a5 on rytilahti:master.

"""Going to target."""
click.echo("Going to target : %s" % vac.goto())

@cli.command()

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

@@ -196,6 +196,17 @@ def home(vac: miio.Vacuum):
"""Return home."""
click.echo("Requesting return to home: %s" % vac.home())

@cli.command()

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

@syssi
Copy link
Collaborator

syssi commented Apr 26, 2018

Do you still need help or does it work already?

@ciB89
Copy link
Contributor Author

ciB89 commented Apr 26, 2018

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.

miio/vacuum.py Outdated
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.

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(

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

@syssi syssi changed the title adding acceptance of multiple zones for app_zoned_cleaning Support of multiple zones for app_zoned_cleaning Aug 21, 2018
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]]"""

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)

@syssi syssi merged commit 2c25b3a into rytilahti:master Aug 21, 2018
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.

4 participants