Home Assistant requests in a task, progress bar, Plex page, bitmap cache

- net/ha_api: the HTTP requests run in a FreeRTOS task on core 0; loop()
  only hands over copies through queues. The web UI's test button polls.
  No more 3-4 s loop() stalls once a minute; timeout raised to 5 s.
- Progress bar page element (page format 4, v3 pages are converted)
- Plex user setting (settings v6): {plex_user} in entity ids
- Plex page (examples): watchers, play/pause icon, title, progress
- Bitmaps cached in RAM: a LittleFS read took ~100 ms on every render
  and web preview; long JSON lists sent in 2 KB pieces
- Backup includes the refresh settings and the Plex user

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-16 16:17:23 +02:00
1 parent 090c2bf8ae
commit 490cefc360
42 files changed
+1074 -175

No files matched your search

+9 -3
View File
@@ -46,11 +46,17 @@ const uint32_t LIVE_TIMEOUT = 30UL * 60 * 1000;
// Power off this long after the display is no longer needed (night, standby)
const uint32_t POWER_OFF_DELAY = 30000;
// Home Assistant values on dynamic pages (net/ha_api): read this often, and the HTTP
// timeout (a read blocks loop() for at most about twice this)
// timeout (connect, then the answer; the requests run in their own task, loop() doesn't wait)
const uint32_t HA_POLL_INTERVAL = 60000;
const uint32_t HA_HTTP_TIMEOUT = 1500;
const uint32_t HA_HTTP_TIMEOUT = 5000;
// After a failed read (Home Assistant down) an entity is read again after this at the soonest
const uint32_t HA_ERROR_INTERVAL = 60000;
// The task that does the requests (net/ha_api): core 0 runs WiFi and the network stack,
// loop() runs on core 1. Stack in bytes.
const int HA_TASK_CORE = 0;
const uint32_t HA_TASK_STACK = 8192;
// A value of the web UI's test button is kept this long for the page to pick it up (ms)
const uint32_t HA_PREVIEW_KEEP = 10000;
// Moving dynamic pages (scrolling, seconds): the next frame waits until the Nano received
// this one (characters per ms at NANO_BAUD) and flipped its changed dots, plus a margin
const uint32_t NANO_CHARS_PER_MS = NANO_BAUD / 10000;
@@ -112,7 +118,7 @@ const uint32_t SETUP_AP_DELAY = 20000; // open the AP when WiFi fails thi
const uint32_t WIFI_CONNECT_TIMEOUT = 30000;
const uint32_t WIFI_RESTART_TIME = 10UL * 60 * 1000;
#define FIRMWARE_VERSION "2.8.0"
#define FIRMWARE_VERSION "2.9.0"
// Home Assistant device id (do not change: Home Assistant's entities are linked to it)
const uint8_t HA_DEVICE_ID[] = {0x34, 0x86, 0x5d, 0x3a, 0x08, 0x28};