fix: legend unit percent w/o whitespace (#1191)

if UoM = "%", then do not use a whitespace as a delimeter.
This commit is contained in:
ildar170975
2025-01-13 02:24:01 +03:00
committed by GitHub
parent f5261d92c3
commit 9f5cfd9c86

View File

@@ -349,7 +349,11 @@ class MiniGraphCard extends LitElement {
const { show_legend_state = false } = this.config.entities[index];
if (show_legend_state) {
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
if (this.computeUom(index) === '%') {
legend += ` (${this.computeState(state)}${this.computeUom(index)})`;
} else {
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
}
}
return legend;