aioaseko


Nameaioaseko JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/milanmeu/aioaseko
SummaryAsync Python package for the Aseko Pool Live API
upload_time2023-08-26 17:06:22
maintainer
docs_urlNone
authorMilan Meulemans
requires_python>=3.8
licenseLGPLv3+
keywords aseko pool live api asin aqua
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # aioAseko package 
[![PyPI](https://img.shields.io/pypi/v/aioaseko)](https://pypi.org/project/aioaseko/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/aioaseko) [![PyPI - License](https://img.shields.io/pypi/l/aioaseko?color=blue)](https://github.com/milanmeu/aioaseko/blob/main/COPYING)

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
```bash
pip install aioaseko
```

## Usage
### Import
```python
from aioaseko import MobileAccount
```

### Create a `aiohttp.ClientSession` to make requests
```python
from aiohttp import ClientSession
session = ClientSession()
```

### Create a `MobileAccount` instance and login
```python
account = MobileAccount(session, "aioAseko@example.com", "passw0rd")
await account.login()
```

## Example
```python
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())
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/milanmeu/aioaseko",
    "name": "aioaseko",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "aseko pool live api asin aqua",
    "author": "Milan Meulemans",
    "author_email": "milan.meulemans@live.be",
    "download_url": "https://files.pythonhosted.org/packages/37/0f/671be143348ecb29db73b511e3c4178a87e044f1751d7f4caa9c530ffd14/aioaseko-0.1.1.tar.gz",
    "platform": null,
    "description": "# aioAseko package \n[![PyPI](https://img.shields.io/pypi/v/aioaseko)](https://pypi.org/project/aioaseko/) ![PyPI - Downloads](https://img.shields.io/pypi/dm/aioaseko) [![PyPI - License](https://img.shields.io/pypi/l/aioaseko?color=blue)](https://github.com/milanmeu/aioaseko/blob/main/COPYING)\n\nAn async Python wrapper for the Aseko Pool Live API.\n\nThe library is currently limited to the features available on pool.aseko.com.\n\n## Account\nThe library provides a `MobileAccount` and `WebAccount` class to make authenticated requests to the mobile and web API, respectively.\nIn this version of aioAseko, `WebAccount` can only be used to obtain `AccountInfo` and retrieve the account units.\nThe mobile API does not provide `AccountInfo`, so `MobileAccount.login()` will return `None`.\n\n## Installation\n```bash\npip install aioaseko\n```\n\n## Usage\n### Import\n```python\nfrom aioaseko import MobileAccount\n```\n\n### Create a `aiohttp.ClientSession` to make requests\n```python\nfrom aiohttp import ClientSession\nsession = ClientSession()\n```\n\n### Create a `MobileAccount` instance and login\n```python\naccount = MobileAccount(session, \"aioAseko@example.com\", \"passw0rd\")\nawait account.login()\n```\n\n## Example\n```python\nfrom aiohttp import ClientSession\nfrom asyncio import run\n\nimport aioaseko\n\nasync def main():\n    async with ClientSession() as session:\n        account = aioaseko.MobileAccount(session, \"aioAseko@example.com\", \"passw0rd\")\n        try:\n            await account.login()\n        except aioaseko.InvalidAuthCredentials:\n            print(\"The username or password you entered is wrong.\")\n            return\n        units = await account.get_units()\n        for unit in units:\n            print(unit.name)\n            await unit.get_state()\n            print(f\"Water flow: {unit.water_flow}\")\n            for variable in unit.variables:\n                print(variable.name, variable.current_value, variable.unit)\n        await account.logout()\nrun(main())\n```\n",
    "bugtrack_url": null,
    "license": "LGPLv3+",
    "summary": "Async Python package for the Aseko Pool Live API",
    "version": "0.1.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/milanmeu/aioaseko/issues",
        "Documentation": "https://github.com/milanmeu/aioaseko/blob/main/README.md",
        "Homepage": "https://github.com/milanmeu/aioaseko",
        "Say Thanks!": "https://saythanks.io/to/milan.meulemans@live.be",
        "Source Code": "https://github.com/milanmeu/aioaseko"
    },
    "split_keywords": [
        "aseko",
        "pool",
        "live",
        "api",
        "asin",
        "aqua"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb7ee63c17ae2ad53646825476856a02ed6b552c6134be5dc06efc7f4de034bf",
                "md5": "fbeff44a509f9b7a7aeba9e81d213454",
                "sha256": "d5284d7efda65a01a964c6954e1dde9dd4ee71312dc0b002e844bae8e2df1219"
            },
            "downloads": -1,
            "filename": "aioaseko-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fbeff44a509f9b7a7aeba9e81d213454",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 24158,
            "upload_time": "2023-08-26T17:06:21",
            "upload_time_iso_8601": "2023-08-26T17:06:21.400880Z",
            "url": "https://files.pythonhosted.org/packages/fb/7e/e63c17ae2ad53646825476856a02ed6b552c6134be5dc06efc7f4de034bf/aioaseko-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "370f671be143348ecb29db73b511e3c4178a87e044f1751d7f4caa9c530ffd14",
                "md5": "671d1831c39362930d78c93eeb48e82a",
                "sha256": "e20ba8ca1cff9faa4d6a1bded37c49977d7cd424885957df2438142536121ab5"
            },
            "downloads": -1,
            "filename": "aioaseko-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "671d1831c39362930d78c93eeb48e82a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 20409,
            "upload_time": "2023-08-26T17:06:22",
            "upload_time_iso_8601": "2023-08-26T17:06:22.924278Z",
            "url": "https://files.pythonhosted.org/packages/37/0f/671be143348ecb29db73b511e3c4178a87e044f1751d7f4caa9c530ffd14/aioaseko-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-26 17:06:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "milanmeu",
    "github_project": "aioaseko",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aioaseko"
}
        
Elapsed time: 0.10386s