Metadata-Version: 2.4
Name: ihcctl
Version: 0.2.0
Summary: Python library and CLI for local Zehnder IHC control
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: bleak>=0.22
Provides-Extra: test
Requires-Dist: pytest>=8; extra == "test"

# ihcctl

`ihcctl` is a Python library and CLI for local Zehnder IHC controller control
over Bluetooth Low Energy. Normal use does not require a cloud service.

The distribution is `ihcctl`; the Python import namespace remains
`zehnder_ihc`; the CLI command is `ihcctl`.

## Install

For the CLI, prefer pipx:

```bash
pipx install ihcctl
ihcctl --help
```

Alternatively install into a Python environment:

```bash
python -m pip install ihcctl
```

The first public release, `ihcctl` 0.2.0, is prepared but not yet published.
Until public publication and verification, these are the intended future
commands rather than a current PyPI installation path.

## Python library and CLI

Use `import zehnder_ihc` or import public classes directly:

```python
from zehnder_ihc import IHCClient
```

The CLI requires a Bluetooth address and an externally stored identity file.
Do not commit it or share it with Home Assistant.

```bash
ihcctl --help
ihcctl register --help
```

Registration requires physical IHC confirmation. The help commands do not
contact hardware. Do not keep the CLI connected while Home Assistant polls the
same controller.

## Home Assistant

The custom integration uses the same `zehnder_ihc` library internally. During
this preparation phase its `manifest.json` deliberately retains the existing
local direct-wheel requirement; it has not switched to `ihcctl`.

Only after a verified public PyPI release will a separately authorized change
pin it to `ihcctl==0.2.0`. Do not manually install, uninstall, or remove
packages in a Home Assistant container.

The optional Schedule Manager resource is:

```yaml
url: /zehnder_ihc/frontend/zehnder-ihc-schedule-card.js
type: module
```

## Development / fallback workflow

`tools/start-local-pypi.sh` and local pypiserver remain development/fallback
tools. They are not the normal workflow for new CLI users or the intended
production Home Assistant workflow after public PyPI migration. Existing Home
Assistant deployments still need the current local wheel until the later
manifest migration succeeds.

For repository work, use the existing test extra:

```bash
python -m venv .venv
source .venv/bin/activate
python -m pip install -e ".[test]"
python -m pytest -q
```

Tests use sanitized frames and fake BLE backends; they do not contact IHC
hardware or perform writes.

## Publishing

Maintainers must read [the publishing guide](docs/publishing-pypi.md). Local
readiness never publishes:

```bash
tools/release-pypi.sh --check
```

TestPyPI and production PyPI require separate explicit authorization.

## Safety

Phase-1 research is frozen. Never commit client identities, `ihc-client*.json`,
or files under `phase1-private/`. Hardware-changing tests need explicit
approval and protocol-level readback where possible.
