Every percentage and unit on the screens spaced like Home Assistant, also the tile values and YAML lambdas

The standard tile still joined a unit with a space, and the climate status, cover and light values and the slider
overlay wrote their own "%": all go through screen_text::with_unit / percent now (54% in Spanish, 54 % in German).
Found on the Guition in the end-to-end test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-19 17:24:33 +02:00
parent f02f429188
commit f7c452e7a7
4 changed files with 6 additions and 12 deletions
+1 -2
View File
@@ -691,9 +691,8 @@ script:
// What the device does (Heating), else its mode (Heat); then the room.
std::string status = off ? std::string(screen_text::tr(screen_text::txt::ha_off)) : std::string(tile_controls::climate_action_text(lower(id(active_climate_action))));
if (status.empty()) status = tile_controls::climate_mode_text(mode);
char part[32];
if (std::isfinite(id(active_climate_current))) status += " · " + screen_text::fill(screen_text::txt::climate_now, "value", screen_text::decimal(id(active_climate_current), 1) + "°");
if (id(active_climate_humidity) >= 0) { snprintf(part, sizeof(part), " · %d%%", id(active_climate_humidity)); status += part; }
if (id(active_climate_humidity) >= 0) status += " · " + screen_text::percent(id(active_climate_humidity));
lv_label_set_text(id(climate_current_label), status.c_str());
int target = id(active_climate_target_x10);
+1 -2
View File
@@ -925,9 +925,8 @@ script:
// What the device does (Heating), else its mode (Heat); then the room.
std::string status = off ? std::string(screen_text::tr(screen_text::txt::ha_off)) : std::string(tile_controls::climate_action_text(lower(id(active_climate_action))));
if (status.empty()) status = tile_controls::climate_mode_text(mode);
char part[32];
if (std::isfinite(id(active_climate_current))) status += " · " + screen_text::fill(screen_text::txt::climate_now, "value", screen_text::decimal(id(active_climate_current), 1) + "°");
if (id(active_climate_humidity) >= 0) { snprintf(part, sizeof(part), " · %d%%", id(active_climate_humidity)); status += part; }
if (id(active_climate_humidity) >= 0) status += " · " + screen_text::percent(id(active_climate_humidity));
lv_label_set_text(id(climate_current_label), status.c_str());
int target = id(active_climate_target_x10);