Skip to content

Commit e8d6f3d

Browse files
authored
Merge pull request #25 from graphras-com/docs/mkdocs-setup
Add MkDocs documentation with mkdocstrings
2 parents 1376fda + 5062504 commit e8d6f3d

18 files changed

Lines changed: 153 additions & 0 deletions

docs/index.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# HaClient
2+
3+
Async-first, high-level Python client for Home Assistant with REST and WebSocket support.
4+
5+
## Features
6+
7+
- Async context manager with automatic WebSocket connection and state priming
8+
- Typed domain accessors: light, switch, climate, cover, sensor, binary sensor, media player
9+
- Real-time state change listeners with granular filtering
10+
- Synchronous blocking wrapper for scripts, REPL, and Jupyter
11+
- Automatic WebSocket reconnection with exponential backoff
12+
- Fully typed (PEP 561) with strict mypy enforcement
13+
14+
## Installation
15+
16+
```bash
17+
pip install haclient
18+
```
19+
20+
Or install from source:
21+
22+
```bash
23+
git clone https://github.com/graphras-com/HaClient.git
24+
cd HaClient
25+
pip install .
26+
```
27+
28+
## Quick Start
29+
30+
### Async
31+
32+
```python
33+
from haclient import HAClient
34+
35+
async with HAClient("http://localhost:8123", token="YOUR_TOKEN") as ha:
36+
light = ha.light("kitchen")
37+
await light.turn_on(brightness=200)
38+
```
39+
40+
### Synchronous
41+
42+
```python
43+
from haclient import SyncHAClient
44+
45+
with SyncHAClient("http://localhost:8123", token="YOUR_TOKEN") as ha:
46+
light = ha.light("kitchen")
47+
light.turn_on(brightness=200)
48+
```

docs/reference/client.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Client
2+
3+
::: haclient.client
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Binary Sensor
2+
3+
::: haclient.domains.binary_sensor

docs/reference/domains/climate.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Climate
2+
3+
::: haclient.domains.climate

docs/reference/domains/cover.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Cover
2+
3+
::: haclient.domains.cover

docs/reference/domains/light.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Light
2+
3+
::: haclient.domains.light
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Media Player
2+
3+
::: haclient.domains.media_player

docs/reference/domains/sensor.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Sensor
2+
3+
::: haclient.domains.sensor

docs/reference/domains/switch.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Switch
2+
3+
::: haclient.domains.switch

docs/reference/entity.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Entity
2+
3+
::: haclient.entity

0 commit comments

Comments
 (0)