dummy-switch: close stdin

This commit is contained in:
Koushik Dutta
2021-09-28 00:20:11 -07:00
parent 0a92d08c97
commit ca0ccdc7cc
3 changed files with 5 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/dummy-motion-sensor",
"version": "0.0.2",
"version": "0.0.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/dummy-motion-sensor",
"version": "0.0.2",
"version": "0.0.4",
"dependencies": {
"@types/node": "^16.6.1",
"axios": "^0.19.0"

View File

@@ -34,5 +34,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.2"
"version": "0.0.4"
}

View File

@@ -58,8 +58,10 @@ class DummySwitch extends ScryptedDeviceBase implements OnOff, Scriptable {
},
});
cp.stdin.write(source.script);
cp.stdin.end();
cp.stdout.on('data', data => this.console.log(data.toString()));
cp.stderr.on('data', data => this.console.log(data.toString()));
cp.on('exit', () => this.console.log('shell exited'));
}
}