You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+98-1Lines changed: 98 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,56 @@
4
4
5
5
HaClient — async Python client for Home Assistant (REST + WebSocket). Single package at `src/haclient/`, built with Hatchling, sole runtime dep is `aiohttp`.
6
6
7
+
## Core Mission
8
+
9
+
Provide a consistent, intuitive, and Pythonic abstraction over the Home Assistant API.
10
+
11
+
Do not mirror the API. Improve it.
12
+
13
+
### Non-Negotiable Rules
14
+
15
+
* Consistency over fidelity
16
+
Do not replicate inconsistent API patterns.
17
+
* Explicit intent over generic services
18
+
Avoid exposing raw service calls like turn_on when intent-specific methods are clearer.
19
+
* Graceful compatibility handling
20
+
Detect feature support and degrade safely. Never break user code due to missing capabilities.
21
+
* Pythonic design
22
+
Interfaces must feel like Python objects, not HTTP wrappers.
23
+
24
+
### Abstraction Rules
25
+
26
+
* Map entities to structured Python objects.
27
+
* Normalize domain inconsistencies.
28
+
* Split overloaded API actions into clear methods.
29
+
30
+
Example:
31
+
32
+
* ❌ light.turn_on(brightness=50)
33
+
* ✅ light.set_brightness(50)
34
+
35
+
### Design Priorities
36
+
37
+
1. Core domains must be clean and stable (Light, Lock, Media Player, Sensor, etc.)
38
+
2. Extend coverage without introducing inconsistency
39
+
3. Support advanced/edge domains only after core stability
40
+
41
+
### Anti-Goals
42
+
43
+
* Do not expose raw API complexity unless necessary
44
+
* Do not enforce strict API parity
45
+
* Do not design around Home Assistant internals—design around user expectations
46
+
47
+
### Implementation Standard
48
+
49
+
Every feature must answer:
50
+
51
+
* Is this intuitive without Home Assistant knowledge?
52
+
* Is this consistent with other domains?
53
+
* Does this degrade safely if unsupported?
54
+
55
+
If not, redesign it.
56
+
7
57
## Setup
8
58
9
59
```bash
@@ -26,7 +76,7 @@ You MUST follow this sequence for every task. Do not write any code before step
26
76
2.**Do the work.**
27
77
3.**Run the full test suite** — every test must pass before you commit:
0 commit comments