mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +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;
|
||||
max_humidity?: number;
|
||||
mode?: string;
|
||||
action: HumidifierAction;
|
||||
action?: HumidifierAction;
|
||||
available_modes?: string[];
|
||||
};
|
||||
};
|
||||
|
@ -165,13 +165,24 @@ export class HuiHumidifierCard extends LitElement implements LovelaceCard {
|
||||
text-anchor="middle"
|
||||
id="set-mode"
|
||||
>
|
||||
${computeStateDisplay(
|
||||
this.hass.localize,
|
||||
stateObj,
|
||||
this.hass.locale,
|
||||
this.hass.config,
|
||||
this.hass.entities
|
||||
)}
|
||||
${
|
||||
stateObj.attributes.action
|
||||
? computeAttributeValueDisplay(
|
||||
this.hass.localize,
|
||||
stateObj,
|
||||
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
|
||||
? html`
|
||||
|
Loading…
x
Reference in New Issue
Block a user