Metadata-Version: 2.4
Name: aioetatouch
Version: 0.1.0
Summary: Async Python client for the ETAtouch REST API of ETA heating systems
Author-email: g4bri3lDev <admin@g4bri3l.de>
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: aiohttp>=3.9
Provides-Extra: cli
Requires-Dist: rich>=13; extra == 'cli'
Description-Content-Type: text/markdown

# aioetatouch

Async Python client for the ETAtouch REST API of ETA heating systems.

This project is a work in progress. The API surface is not yet stable.

Requires Python >=3.12.

## Install

```bash
pip install aioetatouch
```

## Usage

The caller owns the `aiohttp.ClientSession` (the Home Assistant convention);
`EtaClient` never creates or closes it.

```python
import asyncio

import aiohttp

from aioetatouch import EtaClient


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = EtaClient("192.168.1.50", session)

        tree = await client.get_menu()
        for node in tree:
            print(node.uri, node.name)

        value = await client.get_var("/120/10101/0/0/12197")
        print(f"{value.scaled} {value.unit}")


asyncio.run(main())
```

### Read-only, with one caveat

`EtaClient` is read-only with respect to variable *values* -- there is no
method to write a heater's setpoint or state. The one exception is the
`create_set` / `delete_set` / `add_to_set` / `remove_from_set` methods, which
intentionally mutate the device's web-service variable-set containers
(required for bulk polling); they never touch a heater value.

### Errors

All exceptions inherit from `EtaError`:

- `EtaParseError` -- an ETAtouch XML response could not be parsed.
- `EtaConnectionError` -- the device could not be reached (transport
  failure or timeout).
- `EtaApiError` -- the device returned a non-2xx HTTP response; carries
  `status` and `message`.

## CLI

An optional recon/debugging CLI is available via `pip install aioetatouch[cli]`:

```bash
aioetatouch --host 192.168.1.50 menu
aioetatouch --host 192.168.1.50 var /120/10101/0/0/12197
```
