def tucker_stop(req: flask.Request) -> Tuple[str, int]: if not req.method == 'POST': return 'request must be POST', 415 body = req.get_json(silent=True) if not body or body['token'] != API_TOKEN: return 'bad or missing auth', 403 api = sucks.EcoVacsAPI(SUCKS_DEVICE_ID, SUCKS_EMAIL, SUCKS_PASSWORD_HASH, SUCKS_COUNTRY, SUCKS_CONTINENT) tucker = api.devices()[0] vacbot = sucks.VacBot(api.uid, api.REALM, api.resource, api.user_access_token, tucker, SUCKS_CONTINENT) vacbot.connect_and_wait_until_ready() vacbot.run(sucks.Charge()) vacbot.disconnect() return 'ok', 200
def return_to_base(self, **kwargs): """Set the vacuum cleaner to return to the dock.""" self.device.run(sucks.Charge())
def stop(): vacbot.run(sucks.Charge()) # return to the charger
def charge(): dolores.run(sucks.Charge())