Skip to content

Support of multiple zones for app_zoned_cleaning#311

Merged
syssi merged 19 commits intorytilahti:masterfrom
ciB89:master
Aug 21, 2018
Merged

Support of multiple zones for app_zoned_cleaning#311
syssi merged 19 commits intorytilahti:masterfrom
ciB89:master

Conversation

@ciB89
Copy link
Copy Markdown
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.

Comment thread 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]:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

Comment thread 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])
Copy link
Copy Markdown

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
Copy Markdown

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.

Comment thread miio/vacuum_cli.py
"""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

Comment thread miio/vacuum_cli.py
"""Return home."""
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

@syssi
Copy link
Copy Markdown
Collaborator

syssi commented Apr 26, 2018

Do you still need help or does it work already?

@ciB89
Copy link
Copy Markdown
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.

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

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

@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
Comment thread miio/vacuum.py
[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]]"""
Copy link
Copy Markdown

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