Metadata-Version: 2.4
Name: pyitach
Version: 0.1.0
Summary: An asynchronous Python library for controlling Global Caché iTach hardware devices
Project-URL: Homepage, https://github.com/orandasoft/pyitach
Project-URL: Bug-Tracker, https://github.com/orandasoft/pyitach/issues
Author-email: Paul Spee <pypi-library@oranda.dev>
License: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# pyitach

Async Python library for discovering and controlling Global Caché iTach IP2IR devices.

`pyitach` provides low-level access to the Global Caché iTach TCP/IP protocol used by the:

- Global Caché iTach IP2IR

The library is designed for asyncio-based applications and can be used independently of Home Assistant.

---

# Features

- Async TCP client
- UDP multicast device discovery
- IR command transmission
- Device capability queries
- Device identity queries
- Typed Python package (`py.typed`)
- No Home Assistant dependency

---

# Installation

```bash
pip install pyitach
```

---

# Requirements

- Python 3.11+
- asyncio-compatible environment

---

# Supported Devices

The library is currently intended for:

- Global Caché iTach IP2IR

Other Global Caché devices are not currently targeted or officially supported.

---

# Quick Start

## Connect to a Device

```python
import asyncio

from pyitach import ItachClient


async def main() -> None:
    client = ItachClient("192.168.1.211")

    await client.async_connect()

    try:
        devices = await client.async_getdevices()

        print(devices)

    finally:
        await client.async_disconnect()


asyncio.run(main())
```

---

# Sending IR Commands

```python
import asyncio

from pyitach import ItachClient


async def main() -> None:
    client = ItachClient("192.168.1.211")

    await client.async_connect()

    try:
        await client.async_sendir(
            connector=1,
            command=(
                "sendir,1:1,1,38000,1,1,"
                "343,171,21,21,21,64"
            ),
        )

    finally:
        await client.async_disconnect()


asyncio.run(main())
```

---

# Device Discovery

## One-Shot Discovery

```python
import asyncio

from pyitach.discovery import async_discover_once


async def main() -> None:
    beacon = await async_discover_once(timeout=5.0)

    print(beacon)


asyncio.run(main())
```

---

# Discovery Listener

```python
import asyncio

from pyitach.discovery import (
    ItachDiscoveryBeacon,
    ItachDiscoveryListener,
)


async def on_beacon(beacon: ItachDiscoveryBeacon) -> None:
    print(beacon)


async def main() -> None:
    listener = ItachDiscoveryListener(on_beacon)

    await listener.async_start()

    await asyncio.sleep(60)

    await listener.async_stop()


asyncio.run(main())
```

---

# Development

## Clone Repository

```bash
git clone https://github.com/<username>/pyitach.git
cd pyitach
```

---

## Create Virtual Environment

```bash
python -m venv .venv
source .venv/bin/activate
```

Windows PowerShell:

```powershell
.venv\Scripts\Activate.ps1
```

---

## Install Development Dependencies

```bash
uv sync --group dev
```

---

## Run Tests

```bash
pytest
```

---

## Run Type Checking

```bash
mypy src tests
```

---

## Build Package

```bash
python -m build
```

---

# Project Structure

```text
src/pyitach/
    __init__.py
    client.py
    protocol.py
    discovery.py
    capabilities.py
    identity.py
    exceptions.py
```

---

# License

Apache-2.0

---

# Disclaimer

Global Caché is a trademark of Global Caché, Inc.

