Metadata-Version: 2.4
Name: wisehouse-client
Version: 0.1.0
Summary: Unofficial client for the WiseHouse building-management API. Not affiliated with, endorsed by, or supported by WiseHouse / Neware.
Keywords: wisehouse,home-assistant,api-client,httpx
Author: Henry Bogaeus
Author-email: Henry Bogaeus <henry.bogaeus@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Home Automation
Classifier: Typing :: Typed
Requires-Dist: httpx>=0.28.1
Requires-Dist: python-dotenv>=1.2.2 ; extra == 'dotenv'
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/hbogaeus/wisehouse-client
Project-URL: Repository, https://github.com/hbogaeus/wisehouse-client
Project-URL: Issues, https://github.com/hbogaeus/wisehouse-client/issues
Provides-Extra: dotenv
Description-Content-Type: text/markdown

# wisehouse-client

> **Unofficial.** Not affiliated with, endorsed by, or supported by
> WiseHouse / Neware.

Python client for the WiseHouse building-management API: doors, facility
bookings, and info pages. Built for a separate Home Assistant integration,
but works standalone too.

## Install

```
uv add wisehouse-client
# or: pip install wisehouse-client
```

The `.env`/`load_credentials` convenience needs the optional dotenv extra:

```
uv add "wisehouse-client[dotenv]"
```

## Usage

```python
from wisehouse_client import WisehouseClient, Credentials

client = WisehouseClient(Credentials(username="...", password="...", brf="your-brf"))
client.login()
for door in client.list_available_doors():
    print(door.door_id, door.name)
```

The API base is per-association: `https://<brf>.wisehouse.se/`.

### Async

`AsyncWisehouseClient` mirrors the sync API with `await` and accepts an optional
`httpx.AsyncClient` (e.g. Home Assistant's shared client). A client it creates
itself is closed on `aclose()` / `async with`; an injected one is left open.

```python
from wisehouse_client import AsyncWisehouseClient, Credentials

async with AsyncWisehouseClient(creds) as client:
    await client.login()
    doors = await client.list_available_doors()
```

The client transparently re-logs in and retries once when the session token
expires. The side-effecting methods (`open_door`, `make_booking`,
`remove_booking`, `infopage_vote`) act on the real building system, so call
them deliberately.

## Development

```
uv sync
uv run pytest
```

Tests run offline via `httpx.MockTransport` and recorded fixtures.
