Async Python client for the Hayward Aquarite pool API
Project description
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.
Installation
pip install aioaquarite
Usage
import aiohttp
from aioaquarite import AquariteAuth, AquariteClient
async with aiohttp.ClientSession() as session:
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)
client = AquariteClient(auth)
pools = await client.get_pools()
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 with built-in token refresh + reconnect (recommended).
# The callback is invoked from the Firestore background thread;
# asyncio consumers should wrap it with loop.call_soon_threadsafe.
def on_update(data):
print("Pool updated:", data.get("main", {}).get("temperature"))
subscription = await client.subscribe_pool_resilient(pool_id, on_update)
await client.set_value(pool_id, "filtration.mode", 1)
# Cleanup
await subscription.aclose()
Low-level subscription (0.3-style)
If you want to own the connection lifecycle yourself, the raw watch handle is still available:
watch = await client.subscribe_pool(pool_id, on_update)
# ... maintain token freshness, resubscribe on errors, etc. ...
watch.unsubscribe()
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aioaquarite-0.6.1.tar.gz.
File metadata
- Download URL: aioaquarite-0.6.1.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80b1ad732e5f9326caafa102f6e75e118530d4c3130208bac0945f6f31c73895
|
|
| MD5 |
f4a1d779b174a3973d52beba524fcd37
|
|
| BLAKE2b-256 |
d30c8fc0621fca098b3184d51914bbd82b8511fb90888b9dbcbbafc60a204318
|
Provenance
The following attestation bundles were made for aioaquarite-0.6.1.tar.gz:
Publisher:
publish.yml on fdebrus/aioaquarite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioaquarite-0.6.1.tar.gz -
Subject digest:
80b1ad732e5f9326caafa102f6e75e118530d4c3130208bac0945f6f31c73895 - Sigstore transparency entry: 1709658980
- Sigstore integration time:
-
Permalink:
fdebrus/aioaquarite@0a0102f24ad8f3f977d7953ad78f306b72326958 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/fdebrus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a0102f24ad8f3f977d7953ad78f306b72326958 -
Trigger Event:
release
-
Statement type:
File details
Details for the file aioaquarite-0.6.1-py3-none-any.whl.
File metadata
- Download URL: aioaquarite-0.6.1-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
342c8c74b202ab100f76ed9d0ee1f8b4400fa3b654e065d225de04ecfd151945
|
|
| MD5 |
dfff6c8091d4ac94fad0a3acd4d35d00
|
|
| BLAKE2b-256 |
1b20429e28ecbd08879ac56c5c9aeba7148f2df99355a755d979192745c42951
|
Provenance
The following attestation bundles were made for aioaquarite-0.6.1-py3-none-any.whl:
Publisher:
publish.yml on fdebrus/aioaquarite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aioaquarite-0.6.1-py3-none-any.whl -
Subject digest:
342c8c74b202ab100f76ed9d0ee1f8b4400fa3b654e065d225de04ecfd151945 - Sigstore transparency entry: 1709659113
- Sigstore integration time:
-
Permalink:
fdebrus/aioaquarite@0a0102f24ad8f3f977d7953ad78f306b72326958 -
Branch / Tag:
refs/tags/v0.6.1 - Owner: https://github.com/fdebrus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a0102f24ad8f3f977d7953ad78f306b72326958 -
Trigger Event:
release
-
Statement type: