Metadata-Version: 2.4
Name: aioaquarite
Version: 0.3.0
Summary: Async Python client for the Hayward Aquarite pool API
Author: fdebrus
License-Expression: MIT
Project-URL: Homepage, https://github.com/fdebrus/aioaquarite
Project-URL: Repository, https://github.com/fdebrus/aioaquarite
Project-URL: Issues, https://github.com/fdebrus/aioaquarite/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Home Automation
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9.0
Requires-Dist: google-auth>=2.29.0
Requires-Dist: google-cloud-firestore>=2.16.0
Dynamic: license-file

# aioaquarite

Async Python client for the Hayward Aquarite pool API.

This library provides a standalone API client for interacting with Hayward Aquarite pool equipment via the Hayward cloud service. It is designed to be used as the backend for the [Home Assistant Aquarite integration](https://github.com/fdebrus/hayward-ha).

## Installation

```bash
pip install aioaquarite
```

## Usage

```python
import aiohttp
from aioaquarite import AquariteAuth, AquariteClient

async with aiohttp.ClientSession() as session:
    # Authenticate
    auth = AquariteAuth(session, "user@example.com", "password")
    await auth.authenticate()

    # Stable Firebase UID (`sub` claim of the id token); useful as a
    # config-entry unique_id. Returns None before authenticate() succeeds.
    print("Firebase UID:", auth.user_id)

    # Create client
    client = AquariteClient(auth)

    # List pools
    pools = await client.get_pools()

    # Fetch pool data
    for pool_id, pool_name in pools.items():
        data = await client.fetch_pool_data(pool_id)
        temperature = AquariteClient.get_value(data, "main.temperature")
        print(f"{pool_name}: {temperature}°C")

    # Subscribe to real-time updates
    def on_update(data):
        print("Pool updated:", data.get("main", {}).get("temperature"))

    watch = await client.subscribe_pool(pool_id, on_update)

    # Set a value
    await client.set_value(pool_id, "filtration.mode", 1)

    # Cleanup
    watch.unsubscribe()
```

## License

MIT
