|
|
|
@ -627,13 +627,25 @@ class PlayController {
|
|
|
|
|
const entityVal = value;
|
|
|
|
|
if (_.isArray(entityVal)) {
|
|
|
|
|
for (const entity of entityVal) {
|
|
|
|
|
if (!_.isNil(this.hass.states[entity])) {
|
|
|
|
|
try {
|
|
|
|
|
// eslint-disable-next-line no-await-in-loop
|
|
|
|
|
this.entityStates[entity] = await getState(this.hass, entity);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
// pass
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
if (!_.isNil(this.hass.states[entityVal])) {
|
|
|
|
|
// eslint-disable-next-line no-await-in-loop
|
|
|
|
|
this.entityStates[entityVal] = await getState(this.hass, entityVal);
|
|
|
|
|
}
|
|
|
|
|
} catch (err) {
|
|
|
|
|
// pass
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return this.entityStates;
|
|
|
|
|
};
|
|
|
|
|