Metadata-Version: 2.2
Name: pycaldera
Version: 0.1.dev0
Summary: Unofficial Python client for Caldera Spa API
Home-page: https://github.com/mwatson2/pycaldera
Author: Mark Watson
Author-email: markwatson@cantab.net
License: MIT
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: black>=23.0.0
Requires-Dist: isort>=5.12.0
Requires-Dist: mypy>=1.0.0
Requires-Dist: pylint>=2.17.0
Requires-Dist: pytest>=7.0.0
Requires-Dist: pytest-aiohttp>=1.0.0
Requires-Dist: pytest-asyncio>=0.21.0
Requires-Dist: pytest-cov>=4.0.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-flake8; extra == "test"
Provides-Extra: docs
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: pypandoc>=1.6.3; extra == "docs"
Requires-Dist: readthedocs-sphinx-search; python_version >= "3.6" and extra == "docs"
Requires-Dist: sphinx<6,>=3.5.4; extra == "docs"
Requires-Dist: sphinx-autobuild; extra == "docs"
Requires-Dist: sphinx_book_theme; extra == "docs"
Requires-Dist: watchdog<1.0.0; python_version < "3.6" and extra == "docs"
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: pylint>=2.17.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-aiohttp>=1.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Provides-Extra: all
Requires-Dist: black>=23.0.0; extra == "all"
Requires-Dist: isort>=5.12.0; extra == "all"
Requires-Dist: mypy>=1.0.0; extra == "all"
Requires-Dist: myst-parser; extra == "all"
Requires-Dist: pylint>=2.17.0; extra == "all"
Requires-Dist: pypandoc>=1.6.3; extra == "all"
Requires-Dist: pytest; extra == "all"
Requires-Dist: pytest-aiohttp>=1.0.0; extra == "all"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "all"
Requires-Dist: pytest-cov; extra == "all"
Requires-Dist: pytest-cov>=4.0.0; extra == "all"
Requires-Dist: pytest-flake8; extra == "all"
Requires-Dist: pytest>=7.0.0; extra == "all"
Requires-Dist: readthedocs-sphinx-search; python_version >= "3.6" and extra == "all"
Requires-Dist: sphinx-autobuild; extra == "all"
Requires-Dist: sphinx<6,>=3.5.4; extra == "all"
Requires-Dist: sphinx_book_theme; extra == "all"
Requires-Dist: watchdog<1.0.0; python_version < "3.6" and extra == "all"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# pycaldera

Python client library for controlling Caldera spas via their cloud API.

## Installation

```bash
pip install pycaldera
```

## Usage

```python
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.

```python
client = AsyncCalderaClient(
    email="email@example.com",
    password="password",
    timeout=10.0,      # Optional: request timeout in seconds
    debug=False,       # Optional: enable debug logging
)
```

### Temperature Control

```python
# 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

```python
# 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

```python
await spa.set_lights(True)   # Turn lights on
await spa.set_lights(False)  # Turn lights off
```

### Status & Settings

```python
# 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

1. Clone the repository
2. Create a virtual environment:
   ```bash
   python -m venv venv
   source venv/bin/activate  # or `venv\Scripts\activate` on Windows
   ```
3. Install development dependencies:
   ```bash
   pip install -r requirements-dev.txt
   ```
4. Install pre-commit hooks:
   ```bash
   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. 
