loupedeck-commander 1.4.0 → 1.4.2

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.
@@ -1,58 +1,58 @@
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: Stopped")
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
- try {
41
- exec(cmd, (err, stdout, stderr) => {
42
- if (stdout.length > 0)
43
- self.LogInfo(`SHELLif Out: ${stdout}`)
44
- if (stderr.length > 0)
45
- self.LogError(`SHELLif Err: ${stderr}`)
46
- if (err) {
47
- resolve(err)
48
- } else {
49
- resolve({ stdout, stderr })
50
- }
51
- })
52
- } catch (e) {
53
- console.error(`Error in script: ${e}`)
54
- resolve()
55
- }
56
- })
57
- }
58
- }
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: Stopped")
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
+ try {
41
+ exec(cmd, (err, stdout, stderr) => {
42
+ if (stdout.length > 0)
43
+ self.LogInfo(`SHELLif Out: ${stdout}`)
44
+ if (stderr.length > 0)
45
+ self.LogError(`SHELLif Err: ${stderr}`)
46
+ if (err) {
47
+ resolve(err)
48
+ } else {
49
+ resolve({ stdout, stderr })
50
+ }
51
+ })
52
+ } catch (e) {
53
+ console.error(`Error in script: ${e}`)
54
+ resolve()
55
+ }
56
+ })
57
+ }
58
+ }
package/package.json CHANGED
@@ -1,32 +1,32 @@
1
- {
2
- "name": "loupedeck-commander",
3
- "version": "1.4.0",
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
- "lint": "echo \"INFO: no linter specified\" && exit 0",
9
- "format": "echo \"INFO: no format rule specified\" && exit 0",
10
- "start": "node index.mjs"
11
- },
12
- "dependencies": {
13
- "canvas": "^3.2.0",
14
- "loupedeck": "^7.0.0",
15
- "mkdirp": "^3.0.1",
16
- "node-opcua": "^2.156.0",
17
- "string-template": "^1.0.0",
18
- "yaml": "^2.8.1"
19
- },
20
- "author": "Thomas Schneider",
21
- "license": "Apache-2.0",
22
- "repository": {
23
- "type": "git",
24
- "url": "git@gitlab.com:keckxde/loupedeck-commander.git"
25
- },
26
- "bugs": {
27
- "url": "https://gitlab.com/keckxde/loupedeck-commander/-/issues"
28
- },
29
- "devDependencies": {
30
- "eslint": "^9.16.0"
31
- }
32
- }
1
+ {
2
+ "name": "loupedeck-commander",
3
+ "version": "1.4.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
+ "lint": "echo \"INFO: no linter specified\" && exit 0",
9
+ "format": "echo \"INFO: no format rule specified\" && exit 0",
10
+ "start": "node index.mjs"
11
+ },
12
+ "dependencies": {
13
+ "canvas": "^3.2.1",
14
+ "loupedeck": "^7.0.3",
15
+ "mkdirp": "^3.0.1",
16
+ "node-opcua": "^2.160.0",
17
+ "string-template": "^1.0.0",
18
+ "yaml": "^2.8.2"
19
+ },
20
+ "author": "Thomas Schneider",
21
+ "license": "Apache-2.0",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git@gitlab.com:keckxde/loupedeck-commander.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://gitlab.com/keckxde/loupedeck-commander/-/issues"
28
+ },
29
+ "devDependencies": {
30
+ "eslint": "^9.16.0"
31
+ }
32
+ }
package/profile-1.yaml CHANGED
@@ -1,186 +1,186 @@
1
- name: profile-1
2
- profile: example
3
- description: ""
4
- touch:
5
- center:
6
- "0":
7
- states:
8
- off:
9
- color: "#000055"
10
- textColor: "#FFFFFF"
11
- image: icons/home.png
12
- cmd: echo "{id} {state}"
13
- font: 20px Arial
14
- blink: true
15
- on:
16
- color: "#00ff00"
17
- image: icons/home.png
18
- cmd: echo "{id} {state}"
19
- font: 10px Arial
20
- blink: false
21
- params:
22
- text: "{key}"
23
- "1":
24
- states:
25
- off:
26
- color: "#000099"
27
- image: icons/home.png
28
- cmd: echo "{id} {state} {pressed}"
29
- on:
30
- color: "#00ff00"
31
- image: icons/home.png
32
- cmd: echo "{id} {state} {pressed}"
33
- blink: true
34
- params:
35
- minPressed: 100
36
- text: "{released}"
37
- "2":
38
- states:
39
- off:
40
- color: "#000099"
41
- image: icons/home.png
42
- cmd: echo "{id} {state}"
43
- on:
44
- color: "#00ff00"
45
- image: icons/home.png
46
- cmd: echo "{id} {state}"
47
- "3":
48
- states:
49
- off:
50
- color: "#000099"
51
- image: icons/home.png
52
- cmd: echo "{id} {state}"
53
- on:
54
- color: "#00ff00"
55
- image: icons/home.png
56
- cmd: echo "{id} {state}"
57
- "4":
58
- states:
59
- off:
60
- color: "#000099"
61
- image: icons/home.png
62
- cmd: echo "{id} {state}"
63
- on:
64
- color: "#00ff00"
65
- image: icons/home.png
66
- cmd: echo "{id} {state}"
67
- "5":
68
- states:
69
- off:
70
- color: "#000099"
71
- image: icons/home.png
72
- cmd: echo "{id} {state}"
73
- on:
74
- color: "#00ff00"
75
- image: icons/home.png
76
- cmd: echo "{id} {state}"
77
- "6":
78
- states:
79
- off:
80
- color: "#000099"
81
- image: icons/home.png
82
- cmd: echo "{id} {state}"
83
- on:
84
- color: "#00ff00"
85
- image: icons/home.png
86
- cmd: echo "{id} {state}"
87
- "7":
88
- states:
89
- off:
90
- color: "#000099"
91
- image: icons/home.png
92
- cmd: echo "{id} {state}"
93
- on:
94
- color: "#00ff00"
95
- image: icons/home.png
96
- cmd: echo "{id} {state}"
97
- "8":
98
- states:
99
- off:
100
- color: "#000099"
101
- image: icons/home.png
102
- cmd: echo "{id} {state}"
103
- on:
104
- color: "#00ff00"
105
- image: icons/home.png
106
- cmd: echo "{id} {state}"
107
- "9":
108
- states:
109
- off:
110
- color: "#000099"
111
- image: icons/home.png
112
- cmd: echo "{id} {state}"
113
- on:
114
- color: "#00ff00"
115
- image: icons/home.png
116
- cmd: echo "{id} {state}"
117
- "10":
118
- states:
119
- off:
120
- color: "#000099"
121
- image: icons/home.png
122
- cmd: echo "{id} {state}"
123
- on:
124
- color: "#00ff00"
125
- image: icons/home.png
126
- cmd: echo "{id} {state}"
127
- "11":
128
- states:
129
- off:
130
- color: "#000099"
131
- image: icons/home.png
132
- cmd: echo "{id} {state}"
133
- on:
134
- color: "#00ff00"
135
- image: icons/home.png
136
- cmd: echo "{id} {state}"
137
- left:
138
- "0":
139
- states:
140
- on:
141
- color: "#000000"
142
- cmd: echo "{id} {state}"
143
- right:
144
- "0":
145
- states:
146
- on:
147
- color: "#000000"
148
- cmd: echo "{id} {state}"
149
- knobs:
150
- knobTL:
151
- states:
152
- on:
153
- cmd: echo "{id} {state}"
154
- knobCL:
155
- states:
156
- on:
157
- cmd: echo "{id} {state}"
158
- knobBL:
159
- states:
160
- on:
161
- cmd: echo "{id} {state}"
162
- opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
163
- blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
164
- knobTR:
165
- states:
166
- on:
167
- cmd: echo "{id} {state}"
168
- knobCR:
169
- states:
170
- on:
171
- cmd: echo "{id} {state}"
172
- knobBR:
173
- states:
174
- on:
175
- cmd: echo "{id} {state}"
176
- parameters:
177
- hostname: 127.0.0.1
178
- simnbr: "1"
179
- endpointurl: opc.tcp://{hostname}:4840
180
- publishingInterval: 200
181
- nodeid: ns=0;s=nodeID
182
- textColor: "#abcdff"
183
- textBaseLine: top
184
- textAlign: left
185
- font: 14px Arial
186
- verbose: true
1
+ name: profile-1
2
+ profile: example
3
+ description: ""
4
+ touch:
5
+ center:
6
+ "0":
7
+ states:
8
+ off:
9
+ color: "#000055"
10
+ textColor: "#FFFFFF"
11
+ image: icons/home.png
12
+ cmd: echo "{id} {state}"
13
+ font: 20px Arial
14
+ blink: true
15
+ on:
16
+ color: "#00ff00"
17
+ image: icons/home.png
18
+ cmd: echo "{id} {state}"
19
+ font: 10px Arial
20
+ blink: false
21
+ params:
22
+ text: "{key}"
23
+ "1":
24
+ states:
25
+ off:
26
+ color: "#000099"
27
+ image: icons/home.png
28
+ cmd: echo "{id} {state} {pressed}"
29
+ on:
30
+ color: "#00ff00"
31
+ image: icons/home.png
32
+ cmd: echo "{id} {state} {pressed}"
33
+ blink: true
34
+ params:
35
+ minPressed: 100
36
+ text: "{released}"
37
+ "2":
38
+ states:
39
+ off:
40
+ color: "#000099"
41
+ image: icons/home.png
42
+ cmd: echo "{id} {state}"
43
+ on:
44
+ color: "#00ff00"
45
+ image: icons/home.png
46
+ cmd: echo "{id} {state}"
47
+ "3":
48
+ states:
49
+ off:
50
+ color: "#000099"
51
+ image: icons/home.png
52
+ cmd: echo "{id} {state}"
53
+ on:
54
+ color: "#00ff00"
55
+ image: icons/home.png
56
+ cmd: echo "{id} {state}"
57
+ "4":
58
+ states:
59
+ off:
60
+ color: "#000099"
61
+ image: icons/home.png
62
+ cmd: echo "{id} {state}"
63
+ on:
64
+ color: "#00ff00"
65
+ image: icons/home.png
66
+ cmd: echo "{id} {state}"
67
+ "5":
68
+ states:
69
+ off:
70
+ color: "#000099"
71
+ image: icons/home.png
72
+ cmd: echo "{id} {state}"
73
+ on:
74
+ color: "#00ff00"
75
+ image: icons/home.png
76
+ cmd: echo "{id} {state}"
77
+ "6":
78
+ states:
79
+ off:
80
+ color: "#000099"
81
+ image: icons/home.png
82
+ cmd: echo "{id} {state}"
83
+ on:
84
+ color: "#00ff00"
85
+ image: icons/home.png
86
+ cmd: echo "{id} {state}"
87
+ "7":
88
+ states:
89
+ off:
90
+ color: "#000099"
91
+ image: icons/home.png
92
+ cmd: echo "{id} {state}"
93
+ on:
94
+ color: "#00ff00"
95
+ image: icons/home.png
96
+ cmd: echo "{id} {state}"
97
+ "8":
98
+ states:
99
+ off:
100
+ color: "#000099"
101
+ image: icons/home.png
102
+ cmd: echo "{id} {state}"
103
+ on:
104
+ color: "#00ff00"
105
+ image: icons/home.png
106
+ cmd: echo "{id} {state}"
107
+ "9":
108
+ states:
109
+ off:
110
+ color: "#000099"
111
+ image: icons/home.png
112
+ cmd: echo "{id} {state}"
113
+ on:
114
+ color: "#00ff00"
115
+ image: icons/home.png
116
+ cmd: echo "{id} {state}"
117
+ "10":
118
+ states:
119
+ off:
120
+ color: "#000099"
121
+ image: icons/home.png
122
+ cmd: echo "{id} {state}"
123
+ on:
124
+ color: "#00ff00"
125
+ image: icons/home.png
126
+ cmd: echo "{id} {state}"
127
+ "11":
128
+ states:
129
+ off:
130
+ color: "#000099"
131
+ image: icons/home.png
132
+ cmd: echo "{id} {state}"
133
+ on:
134
+ color: "#00ff00"
135
+ image: icons/home.png
136
+ cmd: echo "{id} {state}"
137
+ left:
138
+ "0":
139
+ states:
140
+ on:
141
+ color: "#000000"
142
+ cmd: echo "{id} {state}"
143
+ right:
144
+ "0":
145
+ states:
146
+ on:
147
+ color: "#000000"
148
+ cmd: echo "{id} {state}"
149
+ knobs:
150
+ knobTL:
151
+ states:
152
+ on:
153
+ cmd: echo "{id} {state}"
154
+ knobCL:
155
+ states:
156
+ on:
157
+ cmd: echo "{id} {state}"
158
+ knobBL:
159
+ states:
160
+ on:
161
+ cmd: echo "{id} {state}"
162
+ opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
163
+ blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
164
+ knobTR:
165
+ states:
166
+ on:
167
+ cmd: echo "{id} {state}"
168
+ knobCR:
169
+ states:
170
+ on:
171
+ cmd: echo "{id} {state}"
172
+ knobBR:
173
+ states:
174
+ on:
175
+ cmd: echo "{id} {state}"
176
+ parameters:
177
+ hostname: 127.0.0.1
178
+ simnbr: "1"
179
+ endpointurl: opc.tcp://{hostname}:4840
180
+ publishingInterval: 200
181
+ nodeid: ns=0;s=nodeID
182
+ textColor: "#abcdff"
183
+ textBaseLine: top
184
+ textAlign: left
185
+ font: 14px Arial
186
+ verbose: true