Skip to main content

Access API for echorobotics robot lawn mowers

Project description

pyechorobotics

echorobotics_logo

Allows control and reads status of robot lawn mowers by echorobotics.

Example:

import sys

import echoroboticsapi
import aiohttp
import asyncio
import logging


async def main():
    async with aiohttp.ClientSession(cookies=echoroboticsapi.create_cookies(user_id="your-user-id", user_token="user-user-token")) as session:
        api = echoroboticsapi.Api(session, robot_ids=["your-robot-id"])
        print(await api.last_statuses())
        print(await api.set_mode("chargeAndWork"))


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

Unfortunately, the API doesn't tell is which mode the robot is in. We can make an educated guess though, depending on what we set ourselves, history events and the status. This is what SmartMode does:

import sys

import echoroboticsapi
import aiohttp
import asyncio
import logging


async def main():
    async with aiohttp.ClientSession(cookies=echoroboticsapi.create_cookies(user_id="your-user-id", user_token="user-user-token")) as session:
        api = echoroboticsapi.Api(session, robot_ids=["your-robot-id"])
        smartmode = echoroboticsapi.SmartMode("your-robot-id")
        api.register_smart_mode(smartmode)
        
        print(await api.history_list())
        print(await api.last_statuses())
        print(await smartmode.get_robot_mode())


if __name__ == "__main__":
    logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())

See also src/main.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyechorobotics-0.0.8.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

pyechorobotics-0.0.8-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file pyechorobotics-0.0.8.tar.gz.

File metadata

  • Download URL: pyechorobotics-0.0.8.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for pyechorobotics-0.0.8.tar.gz
Algorithm Hash digest
SHA256 c36ddee67f375f9aad4ecc7e467729c8a1470f41d1d54f7ee9192c800c7f0ab0
MD5 da63409704361d41885e752cac1b39a7
BLAKE2b-256 2f68ea667a623384f21be53f753032814ae03f312cb4762f767c469ec24e7afb

See more details on using hashes here.

File details

Details for the file pyechorobotics-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for pyechorobotics-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 73224604b411119db49e018a8c79af70dc2e9bd215bf1d2152117f15f01a001e
MD5 45ee33dd1df22c305b7f4632a78b6421
BLAKE2b-256 08b29d76bed1daa02bf9e2bcbecf2177ddf19c3cd5653f19c40959b911c87a13

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page