* Performs the configured action sequence. * * @return {!Promise } a promise that will resolve when all actions have * been completed.
()
| 971 | * been completed. |
| 972 | */ |
| 973 | async perform() { |
| 974 | const _actions = [] |
| 975 | this.sequences_.forEach((actions, device) => { |
| 976 | if (!isIdle(actions)) { |
| 977 | actions = actions.concat() // Defensive copy. |
| 978 | _actions.push(Object.assign({ actions }, device.toJSON())) |
| 979 | } |
| 980 | }) |
| 981 | |
| 982 | if (_actions.length === 0) { |
| 983 | return Promise.resolve() |
| 984 | } |
| 985 | |
| 986 | await this.executor_.execute(new Command(Name.ACTIONS).setParameter('actions', _actions)) |
| 987 | } |
| 988 | |
| 989 | getSequences() { |
| 990 | const _actions = [] |