Add spotclean to cli
Add spotclean to cli
This commit is contained in:
Vendored
+3
-2
@@ -18,8 +18,9 @@
|
||||
"program": "${workspaceFolder}/sucks/cli.py",
|
||||
"args" : [
|
||||
"--debug",
|
||||
"clean",
|
||||
"10"
|
||||
"spotclean",
|
||||
"0",
|
||||
"60"
|
||||
],
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
|
||||
+4
-4
@@ -360,11 +360,11 @@ class VacBot():
|
||||
|
||||
|
||||
def connect_and_wait_until_ready(self):
|
||||
if self.vacuum['iot']:
|
||||
self.iot.connect_and_wait_until_ready()
|
||||
self.iot.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
||||
if not self.vacuum['iot']:
|
||||
#self.iot.connect_and_wait_until_ready()
|
||||
#self.iot.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
||||
|
||||
else:
|
||||
#else:
|
||||
self.xmpp.connect_and_wait_until_ready()
|
||||
self.xmpp.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
||||
|
||||
|
||||
+11
-12
@@ -179,6 +179,12 @@ def edge(frequency, minutes):
|
||||
return CliAction(Edge(), wait=TimeWait(minutes * 60))
|
||||
|
||||
|
||||
@cli.command(help='spotcleans provided room(s) for the specified number of minutes')
|
||||
@click.argument('room', type=click.STRING)
|
||||
@click.argument('minutes', type=click.FLOAT)
|
||||
def spotclean(room, minutes):
|
||||
return CliAction(SpotArea('start', room), wait=TimeWait(minutes * 60))
|
||||
|
||||
@cli.command(help='returns to charger')
|
||||
def charge():
|
||||
return charge_action()
|
||||
@@ -211,20 +217,13 @@ def run(actions, debug):
|
||||
api = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'],
|
||||
config['country'], config['continent'])
|
||||
vacuum = api.devices()[0]
|
||||
|
||||
vacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, vacuum, config['continent'])
|
||||
#vacbot.connect_and_wait_until_ready()(
|
||||
vacbot.connect_and_wait_until_ready()
|
||||
|
||||
|
||||
vacbot.run(SpotArea('start'))
|
||||
|
||||
|
||||
#vacbot.request_all_statuses()
|
||||
|
||||
# for action in actions:
|
||||
# click.echo("performing " + str(action.vac_command))
|
||||
# vacbot.run(action.vac_command)
|
||||
# action.wait.wait(vacbot)
|
||||
for action in actions:
|
||||
click.echo("performing " + str(action.vac_command))
|
||||
vacbot.run(action.vac_command)
|
||||
action.wait.wait(vacbot)
|
||||
|
||||
vacbot.disconnect(wait=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user