mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Humidifier action (#17056)
* Add action attribute to humidifier * Humidifier: Use action instead of state if that is available * rebase --------- Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
345aef8d65
commit
81bd4a247b
@ -14,7 +14,7 @@ export type HumidifierEntity = HassEntityBase & {
|
|||||||
min_humidity?: number;
|
min_humidity?: number;
|
||||||
max_humidity?: number;
|
max_humidity?: number;
|
||||||
mode?: string;
|
mode?: string;
|
||||||
action: HumidifierAction;
|
action?: HumidifierAction;
|
||||||
available_modes?: string[];
|
available_modes?: string[];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -165,13 +165,24 @@ export class HuiHumidifierCard extends LitElement implements LovelaceCard {
|
|||||||
text-anchor="middle"
|
text-anchor="middle"
|
||||||
id="set-mode"
|
id="set-mode"
|
||||||
>
|
>
|
||||||
${computeStateDisplay(
|
${
|
||||||
this.hass.localize,
|
stateObj.attributes.action
|
||||||
stateObj,
|
? computeAttributeValueDisplay(
|
||||||
this.hass.locale,
|
this.hass.localize,
|
||||||
this.hass.config,
|
stateObj,
|
||||||
this.hass.entities
|
this.hass.locale,
|
||||||
)}
|
this.hass.config,
|
||||||
|
this.hass.entities,
|
||||||
|
"action"
|
||||||
|
)
|
||||||
|
: computeStateDisplay(
|
||||||
|
this.hass.localize,
|
||||||
|
stateObj,
|
||||||
|
this.hass.locale,
|
||||||
|
this.hass.config,
|
||||||
|
this.hass.entities
|
||||||
|
)
|
||||||
|
}
|
||||||
${
|
${
|
||||||
stateObj.state !== UNAVAILABLE && stateObj.attributes.mode
|
stateObj.state !== UNAVAILABLE && stateObj.attributes.mode
|
||||||
? html`
|
? html`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user