loupedeck-commander 1.2.3 → 1.2.4
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/LICENSE +201 -0
- package/README.md +131 -131
- package/VERSION.md +32 -32
- package/common/ApplicationConfig.mjs +219 -84
- package/common/BaseLoupeDeckHandler.mjs +333 -326
- package/common/cmd-executer.mjs +16 -16
- package/common/index.mjs +5 -5
- package/common/touchbuttons.mjs +534 -534
- package/common/utils.mjs +30 -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 -69
- package/interfaces/httpif.mjs +90 -81
- package/interfaces/opcuaif.mjs +296 -291
- package/interfaces/shellif.mjs +53 -47
- package/package.json +29 -29
- package/profile-1.json +373 -280
- package/test.mjs +26 -22
package/interfaces/shellif.mjs
CHANGED
|
@@ -1,47 +1,53 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
this.
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
+
var res = this.Check(options)
|
|
11
|
+
if (res<0){
|
|
12
|
+
return false
|
|
13
|
+
}
|
|
14
|
+
let formattedCmd = super.call(cmd, options)
|
|
15
|
+
return await this.sh(formattedCmd)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async stop(){
|
|
19
|
+
this.LogInfo("SHELLif: Stopping")
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Check(options) {
|
|
23
|
+
var res= super.Check(options)
|
|
24
|
+
if (res <0){
|
|
25
|
+
this.LogError(`SHELLif: mandatory parameter missing\n`)
|
|
26
|
+
return res
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Run a Shell command in ASYNC mode
|
|
32
|
+
* @param {*} cmd
|
|
33
|
+
* @returns
|
|
34
|
+
*/
|
|
35
|
+
async sh (cmd) {
|
|
36
|
+
let self = this;
|
|
37
|
+
this.LogDebug(`ShellIf: runCmd: ${cmd}\n`)
|
|
38
|
+
|
|
39
|
+
return new Promise(function (resolve, reject) {
|
|
40
|
+
exec(cmd, (err, stdout, stderr) => {
|
|
41
|
+
if (stdout.length>0)
|
|
42
|
+
self.LogInfo(`SHELLif Out: ${stdout}`)
|
|
43
|
+
if (stderr.length>0)
|
|
44
|
+
self.LogError(`SHELLif Err: ${stderr}`)
|
|
45
|
+
if (err) {
|
|
46
|
+
reject(err)
|
|
47
|
+
} else {
|
|
48
|
+
resolve({ stdout, stderr })
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
}
|
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": "
|
|
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.
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "loupedeck-commander",
|
|
3
|
+
"version": "1.2.4",
|
|
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": "Apache-2.0",
|
|
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.16.0"
|
|
28
|
+
}
|
|
29
|
+
}
|