Compare commits

...

2 Commits

Author SHA1 Message Date
Christoph Wiechert 1568244c6a
Merge 2100e12192 into 605b096509 2024-02-01 11:20:47 +01:00
Christoph Wiechert 2100e12192
Add support for array-result in triggers_update
Add the ability that a template could return an array of entities.
2024-01-22 13:16:36 +01:00
1 changed files with 5 additions and 1 deletions

View File

@ -215,7 +215,11 @@ class ButtonCard extends LitElement {
} else if (typeof this._config!.triggers_update === 'string') {
const result = this._getTemplateOrValue(this._stateObj, this._config!.triggers_update);
if (result && result !== 'all') {
this._entities.push(result);
if(Array.isArray(result)) {
result.forEach(entity => this._entities.push(entity));
} else {
this._entities.push(result);
}
} else {
this._config.triggers_update = result;
}