diff --git a/CLAUDE.md b/CLAUDE.md index c67ecd4..8e7e1e5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -172,8 +172,18 @@ See README.md for the overview. after adding features; the web page could be served gzipped if it gets tight. - Fonts use the "FDF1" format of `logic/font.h`; the web page writes the same format. `logic/builtin_fonts.cpp` is generated: change `tools/make_builtin_fonts.py` and rerun it. -- Home Assistant values come from HA's REST API (`net/ha_api`), one blocking request per - `loop()` with `HA_HTTP_TIMEOUT`. Keep it that way (watchdog, OTA). +- Home Assistant values come from HA's REST API (`net/ha_api`). The HTTP requests run in + their own FreeRTOS task (core 0, `haApiBegin()`), one at a time; everything else + (entries, watching, values) stays in `loop()`. The task gets copies of what it needs and + answers through a queue of plain structs: never share Strings or other state with it, + and never wait for it in `loop()`. The web UI's test button polls (`{"pending":true}`). + The web server stays in `loop()` on purpose (its handlers touch everything). +- Entity ids may contain `{plex_user}` (`expandEntity()` in `logic/page`), filled in by + `net/ha_api` with `settings.plex_user` in entity id form (`plexUserSlug()`). +- Bitmaps are cached in RAM (`display/bitmap_store`, also missing names): a LittleFS read + takes about 100 ms, and pages are drawn for every frame and every web preview. Writes + must go through `saveBitmap()`/`deleteBitmap()`, which clear the cache. Long JSON lists + are sent in pieces of about 2 KB (`sendPiece()` in `web_ui.cpp`). - Check the page's JavaScript after changes: extract the `