loupedeck-commander 1.4.1 → 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.1",
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,188 +1,186 @@
1
- name: profile-1
2
- profile: example
3
- parameters:
4
- verbose: false
5
- description: ""
6
- touch:
7
- center:
8
- "0":
9
- states:
10
- off:
11
- color: "#000055"
12
- textColor: "#FFFFFF"
13
- image: icons/home.png
14
- cmd: echo "{id} {state}"
15
- font: 20px Arial
16
- blink: true
17
- on:
18
- color: "#00ff00"
19
- image: icons/home.png
20
- cmd: echo "{id} {state}"
21
- font: 10px Arial
22
- blink: false
23
- params:
24
- text: "{key}"
25
- "1":
26
- states:
27
- off:
28
- color: "#000099"
29
- image: icons/home.png
30
- cmd: echo "{id} {state} {pressed}"
31
- on:
32
- color: "#00ff00"
33
- image: icons/home.png
34
- cmd: echo "{id} {state} {pressed}"
35
- blink: true
36
- params:
37
- minPressed: 100
38
- text: "{released}"
39
- "2":
40
- states:
41
- off:
42
- color: "#000099"
43
- image: icons/home.png
44
- cmd: echo "{id} {state}"
45
- on:
46
- color: "#00ff00"
47
- image: icons/home.png
48
- cmd: echo "{id} {state}"
49
- "3":
50
- states:
51
- off:
52
- color: "#000099"
53
- image: icons/home.png
54
- cmd: echo "{id} {state}"
55
- on:
56
- color: "#00ff00"
57
- image: icons/home.png
58
- cmd: echo "{id} {state}"
59
- "4":
60
- states:
61
- off:
62
- color: "#000099"
63
- image: icons/home.png
64
- cmd: echo "{id} {state}"
65
- on:
66
- color: "#00ff00"
67
- image: icons/home.png
68
- cmd: echo "{id} {state}"
69
- "5":
70
- states:
71
- off:
72
- color: "#000099"
73
- image: icons/home.png
74
- cmd: echo "{id} {state}"
75
- on:
76
- color: "#00ff00"
77
- image: icons/home.png
78
- cmd: echo "{id} {state}"
79
- "6":
80
- states:
81
- off:
82
- color: "#000099"
83
- image: icons/home.png
84
- cmd: echo "{id} {state}"
85
- on:
86
- color: "#00ff00"
87
- image: icons/home.png
88
- cmd: echo "{id} {state}"
89
- "7":
90
- states:
91
- off:
92
- color: "#000099"
93
- image: icons/home.png
94
- cmd: echo "{id} {state}"
95
- on:
96
- color: "#00ff00"
97
- image: icons/home.png
98
- cmd: echo "{id} {state}"
99
- "8":
100
- states:
101
- off:
102
- color: "#000099"
103
- image: icons/home.png
104
- cmd: echo "{id} {state}"
105
- on:
106
- color: "#00ff00"
107
- image: icons/home.png
108
- cmd: echo "{id} {state}"
109
- "9":
110
- states:
111
- off:
112
- color: "#000099"
113
- image: icons/home.png
114
- cmd: echo "{id} {state}"
115
- on:
116
- color: "#00ff00"
117
- image: icons/home.png
118
- cmd: echo "{id} {state}"
119
- "10":
120
- states:
121
- off:
122
- color: "#000099"
123
- image: icons/home.png
124
- cmd: echo "{id} {state}"
125
- on:
126
- color: "#00ff00"
127
- image: icons/home.png
128
- cmd: echo "{id} {state}"
129
- "11":
130
- states:
131
- off:
132
- color: "#000099"
133
- image: icons/home.png
134
- cmd: echo "{id} {state}"
135
- on:
136
- color: "#00ff00"
137
- image: icons/home.png
138
- cmd: echo "{id} {state}"
139
- left:
140
- "0":
141
- states:
142
- on:
143
- color: "#000000"
144
- cmd: echo "{id} {state}"
145
- right:
146
- "0":
147
- states:
148
- on:
149
- color: "#000000"
150
- cmd: echo "{id} {state}"
151
- knobs:
152
- knobTL:
153
- states:
154
- on:
155
- cmd: echo "{id} {state}"
156
- knobCL:
157
- states:
158
- on:
159
- cmd: echo "{id} {state}"
160
- knobBL:
161
- states:
162
- on:
163
- cmd: echo "{id} {state}"
164
- opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
165
- blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
166
- knobTR:
167
- states:
168
- on:
169
- cmd: echo "{id} {state}"
170
- knobCR:
171
- states:
172
- on:
173
- cmd: echo "{id} {state}"
174
- knobBR:
175
- states:
176
- on:
177
- cmd: echo "{id} {state}"
178
- parameters:
179
- hostname: 127.0.0.1
180
- simnbr: "1"
181
- endpointurl: opc.tcp://{hostname}:4840
182
- publishingInterval: 200
183
- nodeid: ns=0;s=nodeID
184
- textColor: "#abcdff"
185
- textBaseLine: top
186
- textAlign: left
187
- font: 14px Arial
188
- 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