Example #1
0
File: main.py Project: 04Raju/web
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
Example #2
0
    def return_to_base(self, **kwargs):
        """Set the vacuum cleaner to return to the dock."""

        self.device.run(sucks.Charge())
Example #3
0
def stop():
    vacbot.run(sucks.Charge())  # return to the charger
Example #4
0
def charge():
    dolores.run(sucks.Charge())