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:
@@ -24,17 +24,17 @@ int main() {
|
||||
assert(format_value(NAN, 0.5f, "°") == "--");
|
||||
|
||||
// Curtain: horizontal arrows, open disabled when fully open, stop only when supported.
|
||||
Tile curtain = make("cover.gordijnen", "open", 15); curtain.device_class = "curtain"; curtain.position = 100; curtain.controls = "buttons";
|
||||
Tile curtain = make("cover.curtains", "open", 15); curtain.device_class = "curtain"; curtain.position = 100; curtain.controls = "buttons";
|
||||
std::array<Key, 3> keys;
|
||||
assert(keys_for(curtain, keys) == 3);
|
||||
assert(!strcmp(keys[0].icon, glyph::EXPAND) && keys[0].command == COVER_OPEN && keys[0].disabled);
|
||||
assert(keys[1].command == COVER_STOP && !keys[1].disabled);
|
||||
assert(!strcmp(keys[2].icon, glyph::COLLAPSE) && keys[2].command == COVER_CLOSE && !keys[2].disabled);
|
||||
assert(key_action(curtain, COVER_CLOSE).service == "cover.close_cover");
|
||||
Tile shutter = make("cover.rolluik", "closed", 3); shutter.controls = "buttons";
|
||||
Tile shutter = make("cover.shutter", "closed", 3); shutter.controls = "buttons";
|
||||
assert(keys_for(shutter, keys) == 2 && !strcmp(keys[0].icon, glyph::UP) && keys[1].disabled);
|
||||
assert(status_text(curtain) == "Open · 100%");
|
||||
assert(status_text(shutter) == "Dicht");
|
||||
assert(status_text(shutter) == "Closed");
|
||||
|
||||
// Vacuum: play while docked, pause while cleaning, dock disabled in the dock.
|
||||
Tile robot = make("vacuum.s8", "docked", 30524); robot.controls = "buttons";
|
||||
@@ -57,23 +57,23 @@ int main() {
|
||||
sonos.muted = true; assert(key_action(sonos, MEDIA_MUTE).value == "false");
|
||||
Tile radio = make("media_player.radio", "idle", feature::MEDIA_PLAY | feature::MEDIA_PAUSE); radio.controls = "playback";
|
||||
assert(keys_for(radio, keys) == 1 && !strcmp(keys[0].icon, glyph::PLAY));
|
||||
assert(status_text(radio) == "Inactief");
|
||||
assert(status_text(radio) == "Idle");
|
||||
|
||||
// Climate: mode keys in priority order, at most three, the active one checked.
|
||||
Tile ac = make("climate.airco", "cool"); ac.hvac_modes = "[\"off\",\"heat_cool\",\"cool\",\"heat\",\"fan_only\",\"dry\"]"; ac.controls = "mode"; ac.current = 21.5f; ac.target = 20; ac.step = 1;
|
||||
Tile ac = make("climate.ac", "cool"); ac.hvac_modes = "[\"off\",\"heat_cool\",\"cool\",\"heat\",\"fan_only\",\"dry\"]"; ac.controls = "mode"; ac.current = 21.5f; ac.target = 20; ac.step = 1;
|
||||
assert(keys_for(ac, keys) == 3);
|
||||
assert(keys[0].arg == "off" && keys[1].arg == "heat" && keys[2].arg == "cool" && keys[2].checked && !keys[1].checked);
|
||||
Action mode = key_action(ac, HVAC_MODE, keys[1].arg);
|
||||
assert(mode.service == "climate.set_hvac_mode" && mode.key == "hvac_mode" && mode.value == "heat");
|
||||
assert(status_text(ac) == "Koelen · 21.5°");
|
||||
ac.hvac_action = "cooling"; assert(status_text(ac) == "Koelt · 21.5°");
|
||||
assert(status_text(ac) == "Cool · 21.5°");
|
||||
ac.hvac_action = "cooling"; assert(status_text(ac) == "Cooling · 21.5°");
|
||||
assert(edit_target(ac) == 20 && edit_step(ac) == 1);
|
||||
Action set = edit_action(ac, step_value(edit_target(ac), edit_step(ac), ac.minimum, ac.maximum, 1));
|
||||
assert(set.service == "climate.set_temperature" && set.key == "temperature" && set.value == "21");
|
||||
assert(edit_action(ac, 20.5f).value == "20.5");
|
||||
|
||||
// Numbers edit their own state; selects step through their options with wrap-around.
|
||||
Tile number = make("number.doel", "55"); number.minimum = 0; number.maximum = 100; number.step = 5;
|
||||
Tile number = make("number.target", "55"); number.minimum = 0; number.maximum = 100; number.step = 5;
|
||||
assert(edit_target(number) == 55 && edit_action(number, step_value(55, 5, 0, 100, -1)).value == "50");
|
||||
assert(edit_action(number, 50).service == "number.set_value");
|
||||
Tile select = make("select.stand", "Comfort"); select.options = {"Eco", "Comfort", "Boost"}; select.option_count = 3; select.controls = "stepper";
|
||||
@@ -84,14 +84,14 @@ int main() {
|
||||
select.option_count = 1; assert(keys_for(select, keys) == 2 && keys[0].disabled);
|
||||
|
||||
// Timer, run buttons and toggles.
|
||||
Tile timer = make("timer.eieren", "active"); timer.controls = "buttons";
|
||||
Tile timer = make("timer.eggs", "active"); timer.controls = "buttons";
|
||||
assert(keys_for(timer, keys) == 2 && keys[0].command == TIMER_PAUSE && !keys[1].disabled);
|
||||
timer.state = "idle"; assert(keys_for(timer, keys) == 2 && keys[0].command == TIMER_START && keys[1].disabled);
|
||||
assert(key_action(make("scene.avond", "unknown"), RUN).service == "scene.turn_on");
|
||||
assert(key_action(make("script.alles", "off"), RUN).service == "script.turn_on");
|
||||
assert(key_action(make("input_button.bel", "unknown"), RUN).service == "input_button.press");
|
||||
assert(!strcmp(run_label("scene"), "Activeren") && !strcmp(run_label("button"), "Indrukken"));
|
||||
assert(key_action(make("switch.bureau", "on"), TOGGLE).service == "switch.turn_off");
|
||||
assert(key_action(make("scene.evening", "unknown"), RUN).service == "scene.turn_on");
|
||||
assert(key_action(make("script.all", "off"), RUN).service == "script.turn_on");
|
||||
assert(key_action(make("input_button.bell", "unknown"), RUN).service == "input_button.press");
|
||||
assert(!strcmp(run_label("scene"), "Activate") && !strcmp(run_label("button"), "Press"));
|
||||
assert(key_action(make("switch.desk", "on"), TOGGLE).service == "switch.turn_off");
|
||||
assert(key_action(make("light.lamp", "off"), TOGGLE).service == "light.turn_on");
|
||||
assert(!key_action(make("sensor.x", "1"), TOGGLE).valid());
|
||||
assert(!key_action(make("sensor.x", "1"), RUN).valid());
|
||||
|
||||
Reference in New Issue
Block a user