@testwizard/commands-powerswitch
Version:
23 lines (16 loc) • 604 B
JavaScript
;
const Commands = require('@testwizard/commands-core');
const Result = Commands.ResultForOkAndErrorCode;
class SwitchPowerCommand extends Commands.CommandBase {
constructor(testObject) {
super(testObject, 'SwitchPower');
}
async execute(on) {
if (on === undefined)
throw new Error('on is required');
const requestObj = [on];
const json = await this.executeCommand(requestObj);
return new Result(json, 'switchPower was successful', 'switchPower failed');
}
}
module.exports = SwitchPowerCommand;