geertmeersman / aiorobonect

Python Library to communicate with the Robonect API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aiorobonect

Asynchronous library to communicate with the Robonect API

maintainer buyme_coffee discord

MIT License

GitHub issues Average time to resolve an issue Percentage of issues still open PRs Welcome

Python

github release github release date github last-commit github contributors github commit activity

API Example

"""Test for aiorobonect."""
from aiorobonect import RobonectClient

import asyncio
import json
import aiohttp

async def main():
    host = "10.0.0.99"        ## The Robonect mower IP
    username = "USERNAME"    ## Your Robonect username
    password = "xxxxxxxx"    ## Your Robonect password
    tracking = [             ## Commands to query
                "battery",
                "wlan",
                "version",
                "timer",
                "hour",
                "error"
            ]
    client = RobonectClient(host, username, password)
    try:
        status = await client.async_cmd("status")
        print(status)
        tracking = await client.async_cmds(tracking)
        print(json.dumps(tracking, indent=2))
    except Exception as exception:
        if isinstance(exception, aiohttp.ClientResponseError):
            print(exception)
    await client.session_close()

asyncio.run(main())

About

Python Library to communicate with the Robonect API

License:MIT License


Languages

Language:Python 100.0%