mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
Fix gauge severity using entity state instead of attribute value (#28331)
This commit is contained in:
@@ -96,8 +96,6 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const entityState = Number(stateObj.state);
|
|
||||||
|
|
||||||
if (stateObj.state === UNAVAILABLE) {
|
if (stateObj.state === UNAVAILABLE) {
|
||||||
return html`
|
return html`
|
||||||
<hui-warning
|
<hui-warning
|
||||||
@@ -164,7 +162,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
|||||||
.unit_of_measurement ||
|
.unit_of_measurement ||
|
||||||
""}
|
""}
|
||||||
style=${styleMap({
|
style=${styleMap({
|
||||||
"--gauge-color": this._computeSeverity(entityState),
|
"--gauge-color": this._computeSeverity(Number(valueToDisplay)),
|
||||||
})}
|
})}
|
||||||
.needle=${this._config!.needle}
|
.needle=${this._config!.needle}
|
||||||
.levels=${this._config!.needle ? this._severityLevels() : undefined}
|
.levels=${this._config!.needle ? this._severityLevels() : undefined}
|
||||||
|
|||||||
Reference in New Issue
Block a user