Unofficial Python client for Caldera Spa API
Project description
pycaldera
Python client library for controlling Caldera spas via their cloud API.
Installation
pip install pycaldera
Usage
import asyncio
from pycaldera import AsyncCalderaClient, PUMP_OFF, PUMP_LOW, PUMP_HIGH
async def main():
async with AsyncCalderaClient("email@example.com", "password") as spa:
# Get current spa status
status = await spa.get_spa_status()
print(f"Current temperature: {status.ctrl_head_water_temperature}°F")
# Get detailed live settings
settings = await spa.get_live_settings()
print(f"Target temperature: {settings.ctrl_head_set_temperature}°F")
# Control the spa
await spa.set_temperature(102) # Set temperature to 102°F
await spa.set_pump(1, PUMP_HIGH) # Set pump 1 to high speed
await spa.set_lights(True) # Turn on the lights
asyncio.run(main())
API Reference
AsyncCalderaClient
Main client class for interacting with the spa.
client = AsyncCalderaClient(
email="email@example.com",
password="password",
timeout=10.0, # Optional: request timeout in seconds
debug=False, # Optional: enable debug logging
)
Temperature Control
# Set temperature (80-104°F or 26.5-40°C)
await spa.set_temperature(102) # Fahrenheit
await spa.set_temperature(39, "C") # Celsius
Pump Control
# Set pump speed
await spa.set_pump(1, PUMP_HIGH) # Set pump 1 to high speed
await spa.set_pump(2, PUMP_LOW) # Set pump 2 to low speed
await spa.set_pump(3, PUMP_OFF) # Turn off pump 3
Light Control
await spa.set_lights(True) # Turn lights on
await spa.set_lights(False) # Turn lights off
Status & Settings
# Get basic spa status
status = await spa.get_spa_status()
print(f"Spa name: {status.spaName}")
print(f"Current temp: {status.ctrl_head_water_temperature}°F")
print(f"Online: {status.status == 'ONLINE'}")
# Get detailed live settings
settings = await spa.get_live_settings()
print(f"Target temp: {settings.ctrl_head_set_temperature}°F")
print(f"Pump 1 speed: {settings.usr_set_pump1_speed}")
print(f"Lights on: {settings.usr_set_light_state}")
Development
- Clone the repository
- Create a virtual environment:
python -m venv venv source venv/bin/activate # or `venv\Scripts\activate` on Windows
- Install development dependencies:
pip install -r requirements-dev.txt
- Install pre-commit hooks:
pre-commit install
The pre-commit hooks will run automatically on git commit, checking:
- Code formatting (Black)
- Import sorting (isort)
- Type checking (mypy)
- Linting (pylint, ruff)
- YAML/TOML syntax
- Trailing whitespace and file endings
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pycaldera-0.1.dev0.tar.gz
(16.8 kB
view details)
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 pycaldera-0.1.dev0.tar.gz.
File metadata
- Download URL: pycaldera-0.1.dev0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a541282ff8307db12d999279094416c3b8248a86fac90e8dbc5822e1635caeb
|
|
| MD5 |
908fef0d68331ec49ee8b70020321102
|
|
| BLAKE2b-256 |
634581a3c59f9cd417151af2758fec3caab9960164d6db65b8ce64ce9aceebfb
|
File details
Details for the file pycaldera-0.1.dev0-py3-none-any.whl.
File metadata
- Download URL: pycaldera-0.1.dev0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf07dfb3a5cc7de87167b42f9d1e11aed330fa5e8d2d3ec567b9e2cde2d2c155
|
|
| MD5 |
0c2ee8484c9d06bd1b727dab0016218c
|
|
| BLAKE2b-256 |
3d752e70ffba1d30ac7537ff636da3a9279b3bd31e9aa7d46001c5c4bb3327e3
|