Skip to content

Commit 4041227

Browse files
trcyberopticclaude
andcommitted
Update CLAUDE.md with empty-body API behavior and aiohttp pitfall
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6d96ea3 commit 4041227

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ HK (heating), BL (boiler), WW (warm water), FRIWA (fresh water), HV (ventilation
8383
## API Behavior Notes
8484

8585
- Control endpoints return HTTP 204 No Content on success — no response body
86+
- Some GET endpoints (e.g. `/v1/plant-events/latest/`) return HTTP 200 with Content-Length: 0 (empty body) instead of 204 or empty JSON when no data exists — `_request` handles this via `content_length == 0` check
8687
- `temporary-change` uses POST with `?duration=FOUR|MIDNIGHT&value={airVolume}` — duration is an **enum** (FOUR = 4 hours, MIDNIGHT = until midnight), NOT a free-form number. Sets air volume/temperature override while keeping time program active.
8788
- `temporary-change/reset` uses POST (no body) to cancel an active override
8889
- `constant` mode (PUT) returns HTTP 500 when a time program (`tteControlled`) is active — use `temporary-change` instead
@@ -100,6 +101,10 @@ HK (heating), BL (boiler), WW (warm water), FRIWA (fresh water), HV (ventilation
100101
- `OptionsFlow.config_entry` is a **read-only property** in modern HA — do NOT assign it in `__init__`. The base class sets it automatically.
101102
- `async_get_options_flow()` should return the flow instance without passing `config_entry`.
102103

104+
## Known Pitfalls
105+
106+
- `aiohttp.resp.json()` on empty body throws `ContentTypeError` (subclass of `ClientError`) — easily misidentified as connection error in generic exception handlers
107+
103108
## Known Gaps
104109

105110
- Temperature history (`/v3/api/statistics/temperature/`) requires `datapoints` param — valid IDs not yet discovered

0 commit comments

Comments
 (0)