Skip to content

Commit

Permalink
make flake8 happy, fix cli when the sequence file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Jul 6, 2017
1 parent c9907bb commit 0ceead2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mirobo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@


@click.group(invoke_without_command=True)
@click.option('--ip', envvar="MIROBO_IP", required=False)
@click.option('--token', envvar="MIROBO_TOKEN", required=False)
@click.option('--ip', envvar="MIROBO_IP")
@click.option('--token', envvar="MIROBO_TOKEN")
@click.option('-d', '--debug', default=False, count=True)
@click.option('--id-file', type=click.File('r+', lazy=False), default='/tmp/python-mirobo.seq')
@click.option('--id-file', type=click.File('w+', lazy=False),
default='/tmp/python-mirobo.seq')
@click.pass_context
def cli(ctx, ip, token, debug, id_file):
"""A tool to command Xiaomi Vacuum robot."""
Expand Down Expand Up @@ -65,6 +66,7 @@ def cleanup(vac, **kwargs):
id_file.truncate()
id_file.write(str(vac.raw_id))


@cli.command()
def discover():
"""Search for robots in the network."""
Expand Down

0 comments on commit 0ceead2

Please sign in to comment.