[skip ci] shutdown script

This commit is contained in:
Brahim Hadriche committed 2025-01-22 18:04:44 -05:00
1 parent 6fd99afd8a
commit 6b62532b48
2 files changed
+24 -1

No files matched your search

+2 -1
View File
@@ -68,7 +68,8 @@
"registry:write": "node tools/registry.js --input registry.json",
"registry:read": "node tools/registry.js --output registry.json",
"registry:clear": "node tools/registry.js --clear",
"restart-app": "node tools/restart-app.js"
"restart-app": "node tools/restart-app.js",
"shutdown": "node tools/shutdown.js"
},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "^4.30.1"
+22
View File
@@ -0,0 +1,22 @@
// Shutdown a Roku device
const rokuTestAutomation = require('roku-test-automation');
const ecp = rokuTestAutomation.ecp;
const utils = rokuTestAutomation.utils;
const Key = rokuTestAutomation.ECP.Key;
const getEnvVars = require('./get-env-vars');
const config = getEnvVars(['ROKU_DEV_TARGET']);
(async () => {
utils.setupEnvironmentFromConfig({
RokuDevice: {
devices: [{
host: config.ROKU_DEV_TARGET,
password: ''
}]
}
});
await ecp.sendKeypress(Key.PowerOff);
})();