Access API for echorobotics robot lawn mowers
Project description
pyechorobotics
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
Release history Release notifications | RSS feed
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.13.tar.gz
(20.8 kB
view details)
Built Distribution
File details
Details for the file pyechorobotics-0.0.13.tar.gz
.
File metadata
- Download URL: pyechorobotics-0.0.13.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7029f45f44742a91ace034cb3ca421bf40fd9589a255cb501a4f81625e2b728c |
|
MD5 | d2a0e9844e4db0c3ff7803b9b439aea9 |
|
BLAKE2b-256 | ff1557deae74b41dc18986296a933e0728a9c5ce17bebc414879cd803e7c4422 |
File details
Details for the file pyechorobotics-0.0.13-py3-none-any.whl
.
File metadata
- Download URL: pyechorobotics-0.0.13-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6cbe81fc956ae94590015ebead56def2394119d294758eb0b4f0c6f6e8a5b95 |
|
MD5 | 1a74fd9f66dd28dc569b6fe8fe23b9ca |
|
BLAKE2b-256 | 6a8835e9fd7d3e1306afebb8da7223b23d4c8bc2c5ae67474d520b179a900be9 |