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",
|
"program": "${workspaceFolder}/sucks/cli.py",
|
||||||
"args" : [
|
"args" : [
|
||||||
"--debug",
|
"--debug",
|
||||||
"clean",
|
"spotclean",
|
||||||
"10"
|
"0",
|
||||||
|
"60"
|
||||||
],
|
],
|
||||||
"console": "integratedTerminal"
|
"console": "integratedTerminal"
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-4
@@ -360,11 +360,11 @@ class VacBot():
|
|||||||
|
|
||||||
|
|
||||||
def connect_and_wait_until_ready(self):
|
def connect_and_wait_until_ready(self):
|
||||||
if self.vacuum['iot']:
|
if not self.vacuum['iot']:
|
||||||
self.iot.connect_and_wait_until_ready()
|
#self.iot.connect_and_wait_until_ready()
|
||||||
self.iot.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
#self.iot.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
||||||
|
|
||||||
else:
|
#else:
|
||||||
self.xmpp.connect_and_wait_until_ready()
|
self.xmpp.connect_and_wait_until_ready()
|
||||||
self.xmpp.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
self.xmpp.schedule('Ping', 30, lambda: self.send_ping(), repeat=True)
|
||||||
|
|
||||||
|
|||||||
+12
-13
@@ -179,6 +179,12 @@ def edge(frequency, minutes):
|
|||||||
return CliAction(Edge(), wait=TimeWait(minutes * 60))
|
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')
|
@cli.command(help='returns to charger')
|
||||||
def charge():
|
def charge():
|
||||||
return charge_action()
|
return charge_action()
|
||||||
@@ -209,22 +215,15 @@ def run(actions, debug):
|
|||||||
if actions:
|
if actions:
|
||||||
config = read_config()
|
config = read_config()
|
||||||
api = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'],
|
api = EcoVacsAPI(config['device_id'], config['email'], config['password_hash'],
|
||||||
config['country'], config['continent'])
|
config['country'], config['continent'])
|
||||||
vacuum = api.devices()[0]
|
vacuum = api.devices()[0]
|
||||||
|
|
||||||
vacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, vacuum, config['continent'])
|
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()
|
||||||
|
|
||||||
|
for action in actions:
|
||||||
vacbot.run(SpotArea('start'))
|
click.echo("performing " + str(action.vac_command))
|
||||||
|
vacbot.run(action.vac_command)
|
||||||
|
action.wait.wait(vacbot)
|
||||||
#vacbot.request_all_statuses()
|
|
||||||
|
|
||||||
# for action in actions:
|
|
||||||
# click.echo("performing " + str(action.vac_command))
|
|
||||||
# vacbot.run(action.vac_command)
|
|
||||||
# action.wait.wait(vacbot)
|
|
||||||
|
|
||||||
vacbot.disconnect(wait=True)
|
vacbot.disconnect(wait=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user