Skip to content

Commit

Permalink
slight ui improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Apr 14, 2017
1 parent 1de2a5f commit 5a823d5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions mirobo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,24 @@ def status(vac):
click.echo(click.style("Error: %s !" % res.error,
bold=True, fg='red'))
click.echo(click.style("State: %s" % res.state, bold=True))
click.echo("Battery: %s" % res.battery)
click.echo("Fanspeed: %s" % res.fanspeed)
click.echo("Battery: %s %%" % res.battery)
click.echo("Fanspeed: %s %%" % res.fanspeed)
click.echo("Cleaning since: %s" % res.clean_time)
click.echo("Cleaned area: %s m²" % res.clean_area)
click.echo("DND enabled: %s" % res.dnd)
click.echo("Map present: %s" % res.map)
click.echo("in_cleaning: %s" % res.in_cleaning)
#click.echo("Map present: %s" % res.map)
#click.echo("in_cleaning: %s" % res.in_cleaning)


@cli.command()
@pass_dev
def consumables(vac):
"""Return consumables status."""
res = vac.consumable_status()
click.echo(res)
click.echo("Main brush: %s (left %s)" % (res.main_brush, res.main_brush_left))
click.echo("Side brush: %s (left %s)" % (res.side_brush, res.side_brush_left))
click.echo("Filter: %s (left %s)" % (res.filter, res.filter_left))
click.echo("Sensor dirty: %s" % res.sensor_dirty)

@cli.command()
@pass_dev
Expand Down Expand Up @@ -127,7 +130,7 @@ def dnd(vac, cmd, start_hr, start_min, end_hr, end_min):
elif cmd == "on":
click.echo("Enabling DND %s:%s to %s:%s" % (start_hr, start_min,
end_hr, end_min))
print(vac.set_dnd(start_hr, start_min, end_hr, end_min))
click.echo(vac.set_dnd(start_hr, start_min, end_hr, end_min))
else:
x = vac.dnd_status()[0]
click.echo("DND %02i:%02i to %02i:%02i (enabled: %s)" % (
Expand Down Expand Up @@ -188,7 +191,7 @@ def find(vac, stop):
@cli.command()
@pass_dev
def map(vac):
"""Get the map."""
"""Returns the map token."""
click.echo(vac.map())


Expand All @@ -198,6 +201,8 @@ def cleaning_history(vac):
"""Query the cleaning history."""
res = vac.clean_history()
click.echo("Total clean count: %s" % res.count)
click.echo("Cleaned for: %s (area: %s m²)" % (res.total_duration, res.total_area))
click.echo()
for idx, id_ in enumerate(res.ids):
for e in vac.clean_details(id_):
color = "green" if e.complete else "yellow"
Expand All @@ -206,6 +211,7 @@ def cleaning_history(vac):
e.complete, e.unknown), bold=True, fg=color))
click.echo(" Area cleaned: %s m²" % e.area)
click.echo(" Duration: (%s)" % e.duration)
click.echo()

@cli.command()
@click.argument('cmd', required=True)
Expand Down

0 comments on commit 5a823d5

Please sign in to comment.