mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix choose description when a non-list form of conditions is used (#18023)
This commit is contained in:
parent
d794ec3408
commit
c69fb77b62
@ -82,26 +82,23 @@ export class HaChooseAction extends LitElement implements ActionElement {
|
|||||||
if (this.isExpanded(idx)) {
|
if (this.isExpanded(idx)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
if (!option.conditions || option.conditions.length === 0) {
|
const conditions = ensureArray(option.conditions);
|
||||||
|
if (!conditions || conditions.length === 0) {
|
||||||
return this.hass.localize(
|
return this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.actions.type.choose.no_conditions"
|
"ui.panel.config.automation.editor.actions.type.choose.no_conditions"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
let str = "";
|
let str = "";
|
||||||
if (typeof option.conditions[0] === "string") {
|
if (typeof conditions[0] === "string") {
|
||||||
str += option.conditions[0];
|
str += conditions[0];
|
||||||
} else {
|
} else {
|
||||||
str += describeCondition(
|
str += describeCondition(conditions[0], this.hass, this._entityReg);
|
||||||
option.conditions[0],
|
|
||||||
this.hass,
|
|
||||||
this._entityReg
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (option.conditions.length > 1) {
|
if (conditions.length > 1) {
|
||||||
str += this.hass.localize(
|
str += this.hass.localize(
|
||||||
"ui.panel.config.automation.editor.actions.type.choose.option_description_additional",
|
"ui.panel.config.automation.editor.actions.type.choose.option_description_additional",
|
||||||
"numberOfAdditionalConditions",
|
"numberOfAdditionalConditions",
|
||||||
option.conditions.length - 1
|
conditions.length - 1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user