Metadata-Version: 2.4
Name: pyantcas
Version: 0.1.0
Summary: Async client for the Antcas Control building-automation protocol
Author: xtrip
License: MIT
Project-URL: Homepage, https://github.com/xtrip/homeassistant-antcas
Project-URL: Source, https://github.com/xtrip/homeassistant-antcas
Project-URL: Issues, https://github.com/xtrip/homeassistant-antcas/issues
Keywords: antcas,home-assistant,building-automation,knx,websocket
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Home Automation
Classifier: Framework :: aiohttp
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9
Requires-Dist: yarl>=1.9

# pyantcas

Async Python client for the **Antcas Control** building-automation protocol (the
WebSocket protocol used by the `*.my.antcas.com` web client).

Used by the [Antcas Home Assistant integration](https://github.com/xtrip/homeassistant-antcas),
but usable standalone.

```python
import asyncio
from pyantcas import AntcasClient

async def main():
    client = AntcasClient("abcd1234.my.antcas.com", 8215,
                          username="user", password="secret")
    await client.async_start()                 # login, discover, open websocket
    await asyncio.wait_for(client.ready.wait(), 30)
    for dev in client.devices:
        print(dev.device_type.value, dev.element_id, dev.name, dev.keys)
    # control example (writes to real hardware!):
    # await client.async_set("<element_id>", {"Switch": True})
    await client.async_stop()

asyncio.run(main())
```

## What it does

- Two-cookie auth (`login=1` credentials / `login=4` session refresh, or a `token`).
- Discovery: navigation → page skeletons (`/visu/data`) → element definitions
  (`/visu/icon`) → `classify()` into device types.
- A single WebSocket: handshake, watch **all** elements, keep the full state map,
  keepalive, reconnect, `set` commands.

## Install

```
pip install pyantcas
```

## License

MIT
