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:
@@ -3164,7 +3164,7 @@ inline void render_slot(size_t slot) {
|
||||
else if (d == "media_player") value = tile_controls::media_state_text(t.state);
|
||||
// A measurement in the screen's number format ("21,5 °C" in Dutch), as Home Assistant writes a state with a unit; a
|
||||
// number without one (a code, a year) stays as it is, as there.
|
||||
else if (!t.unit.empty() && !watch) value = screen_text::localize(value) + " " + t.unit;
|
||||
else if (!t.unit.empty() && !watch) value = screen_text::with_unit(screen_text::localize(value), t.unit);
|
||||
else if (!t.unit.empty() || d == "number" || d == "input_number" || d == "counter") value = screen_text::localize(value);
|
||||
bool pending=t.loading(esphome::millis());
|
||||
if(d=="weather" && std::isfinite(t.current)) {value=screen_text::decimal(t.current,1);if(!watch)value=screen_text::with_unit(value,t.unit);}
|
||||
|
||||
Reference in New Issue
Block a user