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.12.tar.gz (20.8 kB view details)

Uploaded Source

Built Distribution

pyechorobotics-0.0.12-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pyechorobotics-0.0.12.tar.gz
Algorithm Hash digest
SHA256 159553e25c10b3ff94efd9530f419a6a75f8b6260766a5696f3fb176d5070ebe
MD5 20d1ceb51db09def486b4fca8a817cc0
BLAKE2b-256 98a6d3a96aa555a8b8721a15469766eeac3ddd19fd0e7ce92daadeda1ec19dcf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyechorobotics-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 7eae1fa0d1774e5a3adb2990109fec96228bbdbfa572f65d23d379cb450d024c
MD5 39d0adb82e4f5f63367a1d3457b727c0
BLAKE2b-256 90eb0dcae02096c6d58a3e1d9a8d325ed156ef95f3fa1f6b9d59ea65ffba3e3a

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