@testwizard/commands-video
Version:
37 lines (27 loc) • 1.19 kB
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOk;
class SetAttributeOnScreenDisplayCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'SetAttributeOnScreenDisplay');
}
async execute(attributeType, osdArea, textColor, backgroundColor, duration) {
if (attributeType === undefined)
throw new Error('attributeType is required');
const requestObj = [attributeType]
if (osdArea !== undefined) {
requestObj.push(osdArea);
if (textColor !== undefined) {
requestObj.push(textColor);
if (backgroundColor !== undefined) {
requestObj.push(backgroundColor);
if (duration !== undefined)
requestObj.push(duration);
}
}
}
const json = await this.executeCommand(requestObj);
return new Result(json, 'setAttributeOnScreenDisplay was successful', 'setAttributeOnScreenDisplay failed');
}
}
module.exports = SetAttributeOnScreenDisplayCommand;