mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Ensure consistent number display for gauge (#8080)
This commit is contained in:
parent
7f840e75df
commit
775e93d54b
@ -122,12 +122,14 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Use `stateObj.state` as value to keep formatting (e.g trailing zeros)
|
||||||
|
// for consistent value display across gauge, entity, entity-row, etc.
|
||||||
return html`
|
return html`
|
||||||
<ha-card @click=${this._handleClick} tabindex="0">
|
<ha-card @click=${this._handleClick} tabindex="0">
|
||||||
<ha-gauge
|
<ha-gauge
|
||||||
.min=${this._config.min!}
|
.min=${this._config.min!}
|
||||||
.max=${this._config.max!}
|
.max=${this._config.max!}
|
||||||
.value=${state}
|
.value=${stateObj.state}
|
||||||
.language=${this.hass!.language}
|
.language=${this.hass!.language}
|
||||||
.label=${this._config!.unit ||
|
.label=${this._config!.unit ||
|
||||||
this.hass?.states[this._config!.entity].attributes
|
this.hass?.states[this._config!.entity].attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user