Put ESP Screens in English and keep layouts when entity IDs change (0.2.40)

Everything a user sees or reads is now English: both boards' labels,
status replies and logs, the ESP Screens editor and Alerts cheatsheet,
and the README and guides (docs/TILES.md, CALIBRATING.md, ACCEPTANCE.md
and TROUBLESHOOTING.md replace the Dutch file names). Labels follow
Home Assistant's own English names (Heat/Cool modes, Heating/Cooling
actions, Away, Returning to dock, weather conditions), dates use English
abbreviations and the top bar writes numbers the English way. Docs use
HA 2026.9's menu names (Settings -> Apps, App store, Settings -> Tools).
Unused legacy files (home-like.yaml, buttons.yaml, a.out) are removed.

Firmware 0.2.34 names its entities in English. Home Assistant registers
a renamed ESPHome entity under a new entity ID, so the inbox
text.<screen>_tegelinstellingen becomes text.<screen>_tile_settings and
the layout stored under the old ID would be lost. The manager now
recognises the screen by its device, during a run or after a restart,
and moves its layout and update history along; the Update button and
the nightly round follow the screen through the rename. Screens that
still run 0.2.33 or older keep working: both languages are matched.

Main is the only release branch from now on.

Tested on a Home Assistant Yellow (HA 2026.9.1) with both bench boards:
see docs/TEST_RESULTS_0240.md.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-15 02:08:43 +02:00
parent f60eed3ff6
commit 3e959b3df9
87 changed files with 5049 additions and 11167 deletions
+8 -8
View File
@@ -3,8 +3,8 @@
#include <cstdio>
int main() {
using screen_alert::make;
const auto alert = make("Iemand belt aan", "Deur 3, achterkant", "doorbell", "orange", "Ik kom", 60, true, 48, 160, 12);
assert(alert.title == "Iemand belt aan" && alert.subtitle == "Deur 3, achterkant" && alert.button == "Ik kom");
const auto alert = make("Someone's at the door", "Door 3, back entrance", "doorbell", "orange", "Coming", 60, true, 48, 160, 12);
assert(alert.title == "Someone's at the door" && alert.subtitle == "Door 3, back entrance" && alert.button == "Coming");
assert(alert.icon == tile_icon::utf8(0xF12E6) && alert.color == 0xFFE1C6 && alert.timeout_seconds == 60 && alert.flash);
// Icon: a name from the set, with mdi: prefix, spaces or capitals, or the hex codepoint of a carried glyph.
for (const char *icon : {"doorbell", "mdi:doorbell", " Doorbell ", "F12E6", "f12e6", "mdi:F12E6"})
@@ -17,20 +17,20 @@ int main() {
assert(make("x", "", "", " mint ", "", 0, false, 48, 160, 12).color == 0xD5F0EA);
for (const char *color : {"", "none", "auto", "#ff0000", "0xFF0000"})
assert(make("x", "", "", color, "", 0, false, 48, 160, 12).color == 0xFFFFFF);
// Timeout: 0 and negatives wait for Oké; a day is the ceiling.
// Timeout: 0 and negatives wait for OK; a day is the ceiling.
assert(make("x", "", "", "", "", 0, false, 48, 160, 12).timeout_seconds == 0);
assert(make("x", "", "", "", "", -5, false, 48, 160, 12).timeout_seconds == 0);
assert(make("x", "", "", "", "", 999999, false, 48, 160, 12).timeout_seconds == 86400);
assert(!make("x", "", "", "", "", 0, false, 48, 160, 12).flash);
// Title: trimmed, never empty, cut on a UTF-8 boundary; the subtitle keeps its line breaks.
assert(make(" ", "", "", "", "", 0, false, 48, 160, 12).title == "Melding");
assert(make(" Hoi \n", "", "", "", "", 0, false, 48, 160, 12).title == "Hoi");
assert(make(" ", "", "", "", "", 0, false, 48, 160, 12).title == "Notification");
assert(make(" Hi \n", "", "", "", "", 0, false, 48, 160, 12).title == "Hi");
assert(make("\xC3\xA9\xC3\xA9\xC3\xA9", "", "", "", "", 0, false, 3, 160, 12).title == "\xC3\xA9");
assert(make("x", "regel 1\nregel 2", "", "", "", 0, false, 48, 160, 12).subtitle == "regel 1\nregel 2");
assert(make("x", "line 1\nline 2", "", "", "", 0, false, 48, 160, 12).subtitle == "line 1\nline 2");
assert(make("x", std::string(300, 'a'), "", "", "", 0, false, 48, 160, 12).subtitle.size() == 160);
assert(make(std::string(100, 'b'), "", "", "", "", 0, false, 48, 160, 12).title.size() == 48);
// Button: trimmed and capped; empty falls back to Oké.
assert(make("x", "", "", "", "", 0, false, 48, 160, 12).button == "Ok\xC3\xA9");
// Button: trimmed and capped; empty falls back to OK.
assert(make("x", "", "", "", "", 0, false, 48, 160, 12).button == "OK");
assert(make("x", "", "", "", " Open ", 0, false, 48, 160, 12).button == "Open");
assert(make("x", "", "", "", std::string(40, 'c'), 0, false, 48, 160, 12).button.size() == 12);
// The generated table carries every font glyph by name.