Skip to main content

Async Python package for the Aseko Pool Live API

Project description

aioAseko package

PyPI PyPI - Downloads PyPI - License

An async Python wrapper for the Aseko Pool Live API.

The library is currently limited to the features available on pool.aseko.com.

Account

The library provides a MobileAccount and WebAccount class to make authenticated requests to the mobile and web API, respectively. In this version of aioAseko, WebAccount can only be used to obtain AccountInfo and retrieve the account units. The mobile API does not provide AccountInfo, so MobileAccount.login() will return None.

Installation

pip install aioaseko

Usage

Import

from aioaseko import MobileAccount

Create a aiohttp.ClientSession to make requests

from aiohttp import ClientSession
session = ClientSession()

Create a MobileAccount instance and login

account = MobileAccount(session, "aioAseko@example.com", "passw0rd")
await account.login()

Example

from aiohttp import ClientSession
from asyncio import run

import aioaseko

async def main():
    async with ClientSession() as session:
        account = aioaseko.MobileAccount(session, "aioAseko@example.com", "passw0rd")
        try:
            await account.login()
        except aioaseko.InvalidAuthCredentials:
            print("The username or password you entered is wrong.")
            return
        units = await account.get_units()
        for unit in units:
            print(unit.name)
            await unit.get_state()
            print(f"Water flow: {unit.water_flow}")
            for variable in unit.variables:
                print(variable.name, variable.current_value, variable.unit)
        await account.logout()
run(main())

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

aioaseko-0.1.1.tar.gz (20.4 kB view hashes)

Uploaded Source

Built Distribution

aioaseko-0.1.1-py3-none-any.whl (24.2 kB view hashes)

Uploaded Python 3

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