Drop the converters for old data

2.15.0 stored all settings, schedules and pages on the display in the
current formats (old_data_left 0), so only those are read now: settings
version 7, schedule version 4, page format 7. The one-time migrations
(icons from 2.10.0, data from 2.15.0) are removed too. About 9 KB less
flash. CLAUDE.md says how to keep data over a future format change.

Version 2.15.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-17 21:21:25 +02:00
1 parent 968492ca35
commit 9959c1aa74
14 files changed
+28 -996

No files matched your search

+6 -4
View File
@@ -152,7 +152,11 @@ See README.md for the overview.
ESP32 only handles 418-character hex bitmaps (`logic/bitmap_format.h`, MSB = left dot).
- Settings: `logic/settings.h` struct with defaults = original behaviour, stored as an NVS
blob with a version (`system/settings_store.cpp`). When the struct changes, bump
`VERSION` there (old records then fall back to defaults).
`VERSION` there (old records then fall back to defaults). Only the current version is
read: 2.15.0 converted all old settings, schedules and pages on the device, and 2.15.1
dropped the converters. To keep data over a format change, add a frozen copy of the old
layout with a converter (git history before 2.15.1 has examples), and store the
converted data only once the firmware is marked good (a rollback can't read it).
- Bitmaps on LittleFS in the `spiffs` partition (`/bitmaps/<name>.bin`, 209 bytes). Names
are restricted (`validBitmapName`), which also makes them safe in paths and JSON.
- Icons (`logic/icon_format.h`, `display/icon_store`, `/icons/<name>.bin`: width, height,
@@ -160,7 +164,6 @@ See README.md for the overview.
the top left); they are never shown on their own and are not in the page lists or HA
dropdowns. Bitmaps, icons and pages share one namespace. `PageResources::background()`
tries bitmaps, then icons (expanded at 0,0), so the renderer doesn't know the difference.
`appMigrateIcons()` ran once (marker `/icons/.migrated`) after 2.10.0 was marked good.
- LittleFS is slow: listing a directory (`listBitmaps()`, `listPages()`, `storedNames()`)
takes about a second with 40 files. Never list per item in a loop. The first icon
migration did that, hit the 30 s watchdog and crash-looped into the recovery app; work
@@ -174,8 +177,7 @@ See README.md for the overview.
old hardcoded clock (also the default and the HA "Clock" option). `pageStoreBegin()`
stores a copy of each built-in page (`logic/builtin_pages`) at boot when none is stored,
so it can be edited; the built-in one is the fallback, and deleting the copy resets it.
- Pages hold 16 elements (format 6). The old formats in `page_store.cpp` are frozen at
`OLD_PAGE_ELEMENTS` (8). A `DynamicPage` is about 4 KB: allocate it with `new`, and reset
- Pages hold 16 elements (format 7). A `DynamicPage` is about 4 KB: allocate it with `new`, and reset
it with `clearPage()`, not `page = DynamicPage()` (a temporary on the 8 KB loop stack).
- HA attributes may be paths into lists (`forecast.1.condition`, `net/ha_api`). The
forecast comes from the template sensor in `docs/home-assistant.md`.