loupedeck-commander 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -131
- package/VERSION.md +32 -32
- package/common/ApplicationConfig.mjs +84 -84
- package/common/BaseLoupeDeckHandler.mjs +326 -313
- package/common/cmd-executer.mjs +16 -16
- package/common/index.mjs +5 -5
- package/common/touchbuttons.mjs +534 -513
- package/common/utils.mjs +29 -29
- package/config.json +8 -8
- package/eslint.config.mjs +8 -8
- package/example/ExampleDeviceHandler.mjs +44 -44
- package/example/example.mjs +21 -21
- package/index.mjs +3 -3
- package/interfaces/baseif.mjs +69 -68
- package/interfaces/httpif.mjs +81 -81
- package/interfaces/opcuaif.mjs +291 -282
- package/interfaces/shellif.mjs +47 -47
- package/package.json +29 -29
- package/profile-1.json +280 -275
- package/test.mjs +22 -22
package/interfaces/shellif.mjs
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { exec } from 'child_process'
|
|
2
|
-
//import { exec } from 'node:child_process'
|
|
3
|
-
import { BaseIf } from './baseif.mjs'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Our Special-Handler just used the Default - and adds Vibration after triggers through Button-Releases
|
|
7
|
-
*/
|
|
8
|
-
export class SHELLif extends BaseIf {
|
|
9
|
-
async call (cmd, options = {}) {
|
|
10
|
-
cmd = super.call(cmd, options)
|
|
11
|
-
return await this.sh(cmd)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async stop(){
|
|
15
|
-
this.LogInfo("SHELLif: Stopping")
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Check(options) {
|
|
19
|
-
var res= super.Check(options)
|
|
20
|
-
if (res <0)
|
|
21
|
-
return res
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Run a Shell command in ASYNC mode
|
|
26
|
-
* @param {*} cmd
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
async sh (cmd) {
|
|
30
|
-
let self = this;
|
|
31
|
-
this.LogDebug(`ShellIf: runCmd: ${cmd}\n`)
|
|
32
|
-
|
|
33
|
-
return new Promise(function (resolve, reject) {
|
|
34
|
-
exec(cmd, (err, stdout, stderr) => {
|
|
35
|
-
if (stdout.length>0)
|
|
36
|
-
self.LogInfo(`SHELLif Out: ${stdout}`)
|
|
37
|
-
if (stderr.length>0)
|
|
38
|
-
self.LogError(`SHELLif Err: ${stderr}`)
|
|
39
|
-
if (err) {
|
|
40
|
-
reject(err)
|
|
41
|
-
} else {
|
|
42
|
-
resolve({ stdout, stderr })
|
|
43
|
-
}
|
|
44
|
-
})
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
}
|
|
1
|
+
import { exec } from 'child_process'
|
|
2
|
+
//import { exec } from 'node:child_process'
|
|
3
|
+
import { BaseIf } from './baseif.mjs'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Our Special-Handler just used the Default - and adds Vibration after triggers through Button-Releases
|
|
7
|
+
*/
|
|
8
|
+
export class SHELLif extends BaseIf {
|
|
9
|
+
async call (cmd, options = {}) {
|
|
10
|
+
cmd = super.call(cmd, options)
|
|
11
|
+
return await this.sh(cmd)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async stop(){
|
|
15
|
+
this.LogInfo("SHELLif: Stopping")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Check(options) {
|
|
19
|
+
var res= super.Check(options)
|
|
20
|
+
if (res <0)
|
|
21
|
+
return res
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Run a Shell command in ASYNC mode
|
|
26
|
+
* @param {*} cmd
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
async sh (cmd) {
|
|
30
|
+
let self = this;
|
|
31
|
+
this.LogDebug(`ShellIf: runCmd: ${cmd}\n`)
|
|
32
|
+
|
|
33
|
+
return new Promise(function (resolve, reject) {
|
|
34
|
+
exec(cmd, (err, stdout, stderr) => {
|
|
35
|
+
if (stdout.length>0)
|
|
36
|
+
self.LogInfo(`SHELLif Out: ${stdout}`)
|
|
37
|
+
if (stderr.length>0)
|
|
38
|
+
self.LogError(`SHELLif Err: ${stderr}`)
|
|
39
|
+
if (err) {
|
|
40
|
+
reject(err)
|
|
41
|
+
} else {
|
|
42
|
+
resolve({ stdout, stderr })
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "loupedeck-commander",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "A system to ease working with LoupeDeck devices using CMD-line, OPC/UA or HTTP-client interfaces",
|
|
5
|
-
"main": "index.mjs",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "node test.mjs",
|
|
8
|
-
"start": "node index.mjs"
|
|
9
|
-
},
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"canvas": "^2.11.2",
|
|
12
|
-
"loupedeck": "^6.0.1",
|
|
13
|
-
"mkdirp": "^3.0.1",
|
|
14
|
-
"node-opcua": "^2.138.1",
|
|
15
|
-
"string-template": "^1.0.0"
|
|
16
|
-
},
|
|
17
|
-
"author": "Thomas Schneider",
|
|
18
|
-
"license": "MIT",
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git@gitlab.com:keckxde/loupedeck-commander.git"
|
|
22
|
-
},
|
|
23
|
-
"bugs": {
|
|
24
|
-
"url": "https://gitlab.com/keckxde/loupedeck-commander/-/issues"
|
|
25
|
-
},
|
|
26
|
-
"devDependencies": {
|
|
27
|
-
"eslint": "^9.8.0"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "loupedeck-commander",
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "A system to ease working with LoupeDeck devices using CMD-line, OPC/UA or HTTP-client interfaces",
|
|
5
|
+
"main": "index.mjs",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "node test.mjs",
|
|
8
|
+
"start": "node index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"canvas": "^2.11.2",
|
|
12
|
+
"loupedeck": "^6.0.1",
|
|
13
|
+
"mkdirp": "^3.0.1",
|
|
14
|
+
"node-opcua": "^2.138.1",
|
|
15
|
+
"string-template": "^1.0.0"
|
|
16
|
+
},
|
|
17
|
+
"author": "Thomas Schneider",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git@gitlab.com:keckxde/loupedeck-commander.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://gitlab.com/keckxde/loupedeck-commander/-/issues"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"eslint": "^9.8.0"
|
|
28
|
+
}
|
|
29
|
+
}
|