Fix a coloring issue with climate states (#15325)
This commit is contained in:
parent
52d869f5b8
commit
adb65176f0
|
@ -133,7 +133,7 @@ export class StateBadge extends LitElement {
|
|||
}
|
||||
if (stateObj.attributes.hvac_action) {
|
||||
const hvacAction = stateObj.attributes.hvac_action;
|
||||
if (["heating", "cooling", "drying", "fan"].includes(hvacAction)) {
|
||||
if (hvacAction in HVAC_ACTION_TO_MODE) {
|
||||
iconStyle.color = stateColorCss(
|
||||
stateObj,
|
||||
HVAC_ACTION_TO_MODE[hvacAction]
|
||||
|
|
|
@ -323,7 +323,7 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
|||
}
|
||||
if (stateObj.attributes.hvac_action) {
|
||||
const hvacAction = stateObj.attributes.hvac_action;
|
||||
if (["heating", "cooling", "drying", "fan"].includes(hvacAction)) {
|
||||
if (hvacAction in HVAC_ACTION_TO_MODE) {
|
||||
return stateColorCss(stateObj, HVAC_ACTION_TO_MODE[hvacAction]);
|
||||
}
|
||||
return undefined;
|
||||
|
|
|
@ -195,7 +195,7 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
|
|||
private _computeColor(stateObj: HassEntity): string | undefined {
|
||||
if (stateObj.attributes.hvac_action) {
|
||||
const hvacAction = stateObj.attributes.hvac_action;
|
||||
if (["heating", "cooling", "drying", "fan"].includes(hvacAction)) {
|
||||
if (hvacAction in HVAC_ACTION_TO_MODE) {
|
||||
return stateColorCss(stateObj, HVAC_ACTION_TO_MODE[hvacAction]);
|
||||
}
|
||||
return undefined;
|
||||
|
|
Loading…
Reference in New Issue