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.
package/profile-2.yaml CHANGED
@@ -1,213 +1,213 @@
1
- name: profile-1
2
- profile: example
3
- description: ""
4
- touch:
5
- center:
6
- "0":
7
- default: one
8
- states:
9
- off:
10
- color: "#000099"
11
- cmd: echo "{id} {state}"
12
- one:
13
- color: "#00ff00"
14
- image: numbers/one_9278045.png
15
- cmd: echo "{id} {state}"
16
- two:
17
- color: "#00ff00"
18
- image: numbers/two_9278103.png
19
- cmd: echo "{id} {state}"
20
- three:
21
- color: "#00ff00"
22
- image: numbers/three_9278150.png
23
- cmd: echo "{id} {state}"
24
- four:
25
- color: "#00ff00"
26
- image: numbers/four_9278183.png
27
- cmd: echo "{id} {state}"
28
- five:
29
- color: "#00ff00"
30
- image: numbers/five_9278222.png
31
- cmd: echo "{id} {state}"
32
- "1":
33
- default: two
34
- params:
35
- nodeid: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
36
- states:
37
- off:
38
- color: "#000099"
39
- cmd: echo "{id} {state}"
40
- one:
41
- color: "#00ff00"
42
- image: numbers/one_9278045.png
43
- cmd: echo "{id} {state}"
44
- two:
45
- color: "#00ff00"
46
- image: numbers/two_9278103.png
47
- cmd: echo "{id} {state}"
48
- three:
49
- color: "#00ff00"
50
- image: numbers/three_9278150.png
51
- cmd: echo "{id} {state}"
52
- four:
53
- color: "#00ff00"
54
- image: numbers/four_9278183.png
55
- cmd: echo "{id} {state}"
56
- five:
57
- color: "#00ff00"
58
- image: numbers/five_9278222.png
59
- cmd: echo "{id} {state}"
60
- "2":
61
- default: three
62
- states:
63
- off:
64
- color: "#000099"
65
- cmd: echo "{id} {state}"
66
- one:
67
- color: "#00ff00"
68
- image: numbers/one_9278045.png
69
- cmd: echo "{id} {state}"
70
- two:
71
- color: "#00ff00"
72
- image: numbers/two_9278103.png
73
- cmd: echo "{id} {state}"
74
- three:
75
- color: "#00ff00"
76
- image: numbers/three_9278150.png
77
- cmd: echo "{id} {state}"
78
- four:
79
- color: "#00ff00"
80
- image: numbers/four_9278183.png
81
- cmd: echo "{id} {state}"
82
- five:
83
- color: "#00ff00"
84
- image: numbers/five_9278222.png
85
- cmd: echo "{id} {state}"
86
- "3":
87
- default: four
88
- states:
89
- off:
90
- color: "#000099"
91
- cmd: echo "{id} {state}"
92
- one:
93
- color: "#00ff00"
94
- image: numbers/one_9278045.png
95
- cmd: echo "{id} {state}"
96
- two:
97
- color: "#00ff00"
98
- image: numbers/two_9278103.png
99
- cmd: echo "{id} {state}"
100
- three:
101
- color: "#00ff00"
102
- image: numbers/three_9278150.png
103
- cmd: echo "{id} {state}"
104
- four:
105
- color: "#00ff00"
106
- image: numbers/four_9278183.png
107
- cmd: echo "{id} {state}"
108
- five:
109
- color: "#00ff00"
110
- image: numbers/five_9278222.png
111
- cmd: echo "{id} {state}"
112
- "4":
113
- default: five
114
- states:
115
- off:
116
- color: "#000099"
117
- cmd: echo "{id} {state}"
118
- one:
119
- color: "#00ff00"
120
- image: numbers/one_9278045.png
121
- cmd: echo "{id} {state}"
122
- two:
123
- color: "#00ff00"
124
- image: numbers/two_9278103.png
125
- cmd: echo "{id} {state}"
126
- three:
127
- color: "#00ff00"
128
- image: numbers/three_9278150.png
129
- cmd: echo "{id} {state}"
130
- four:
131
- color: "#00ff00"
132
- image: numbers/four_9278183.png
133
- cmd: echo "{id} {state}"
134
- five:
135
- color: "#00ff00"
136
- image: numbers/five_9278222.png
137
- cmd: echo "{id} {state}"
138
- "5":
139
- states:
140
- off:
141
- color: "#000099"
142
- cmd: echo "{id} {state}"
143
- one:
144
- color: "#00ff00"
145
- image: numbers/one_9278045.png
146
- cmd: echo "{id} {state}"
147
- two:
148
- color: "#00ff00"
149
- image: numbers/two_9278103.png
150
- cmd: echo "{id} {state}"
151
- three:
152
- color: "#00ff00"
153
- image: numbers/three_9278150.png
154
- cmd: echo "{id} {state}"
155
- four:
156
- color: "#00ff00"
157
- image: numbers/four_9278183.png
158
- cmd: echo "{id} {state}"
159
- five:
160
- color: "#00ff00"
161
- image: numbers/five_9278222.png
162
- cmd: echo "{id} {state}"
163
- left:
164
- "0":
165
- states:
166
- on:
167
- color: "#000000"
168
- cmd: echo "{id} {state}"
169
- right:
170
- "0":
171
- states:
172
- on:
173
- color: "#000000"
174
- cmd: echo "{id} {state}"
175
- knobs:
176
- knobTL:
177
- states:
178
- on:
179
- cmd: echo "{id} {state}"
180
- group: ""
181
- knobCL:
182
- states:
183
- on:
184
- cmd: echo "{id} {state}"
185
- group: ""
186
- knobBL:
187
- states:
188
- on:
189
- cmd: echo "{id} {state}"
190
- opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
191
- blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
192
- group: ""
193
- knobTR:
194
- states:
195
- on:
196
- cmd: echo "{id} {state}"
197
- group: ""
198
- knobCR:
199
- states:
200
- on:
201
- cmd: echo "{id} {state}"
202
- group: ""
203
- knobBR:
204
- states:
205
- on:
206
- cmd: echo "{id} {state}"
207
- group: ""
208
- parameters:
209
- hostname: 127.0.0.1
210
- simnbr: "1"
211
- endpointurl: opc.tcp://{hostname}:4840
212
- nodeid: ns=0;s=nodeID
213
- verbose: true
1
+ name: profile-1
2
+ profile: example
3
+ description: ""
4
+ touch:
5
+ center:
6
+ "0":
7
+ default: one
8
+ states:
9
+ off:
10
+ color: "#000099"
11
+ cmd: echo "{id} {state}"
12
+ one:
13
+ color: "#00ff00"
14
+ image: numbers/one_9278045.png
15
+ cmd: echo "{id} {state}"
16
+ two:
17
+ color: "#00ff00"
18
+ image: numbers/two_9278103.png
19
+ cmd: echo "{id} {state}"
20
+ three:
21
+ color: "#00ff00"
22
+ image: numbers/three_9278150.png
23
+ cmd: echo "{id} {state}"
24
+ four:
25
+ color: "#00ff00"
26
+ image: numbers/four_9278183.png
27
+ cmd: echo "{id} {state}"
28
+ five:
29
+ color: "#00ff00"
30
+ image: numbers/five_9278222.png
31
+ cmd: echo "{id} {state}"
32
+ "1":
33
+ default: two
34
+ params:
35
+ nodeid: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
36
+ states:
37
+ off:
38
+ color: "#000099"
39
+ cmd: echo "{id} {state}"
40
+ one:
41
+ color: "#00ff00"
42
+ image: numbers/one_9278045.png
43
+ cmd: echo "{id} {state}"
44
+ two:
45
+ color: "#00ff00"
46
+ image: numbers/two_9278103.png
47
+ cmd: echo "{id} {state}"
48
+ three:
49
+ color: "#00ff00"
50
+ image: numbers/three_9278150.png
51
+ cmd: echo "{id} {state}"
52
+ four:
53
+ color: "#00ff00"
54
+ image: numbers/four_9278183.png
55
+ cmd: echo "{id} {state}"
56
+ five:
57
+ color: "#00ff00"
58
+ image: numbers/five_9278222.png
59
+ cmd: echo "{id} {state}"
60
+ "2":
61
+ default: three
62
+ states:
63
+ off:
64
+ color: "#000099"
65
+ cmd: echo "{id} {state}"
66
+ one:
67
+ color: "#00ff00"
68
+ image: numbers/one_9278045.png
69
+ cmd: echo "{id} {state}"
70
+ two:
71
+ color: "#00ff00"
72
+ image: numbers/two_9278103.png
73
+ cmd: echo "{id} {state}"
74
+ three:
75
+ color: "#00ff00"
76
+ image: numbers/three_9278150.png
77
+ cmd: echo "{id} {state}"
78
+ four:
79
+ color: "#00ff00"
80
+ image: numbers/four_9278183.png
81
+ cmd: echo "{id} {state}"
82
+ five:
83
+ color: "#00ff00"
84
+ image: numbers/five_9278222.png
85
+ cmd: echo "{id} {state}"
86
+ "3":
87
+ default: four
88
+ states:
89
+ off:
90
+ color: "#000099"
91
+ cmd: echo "{id} {state}"
92
+ one:
93
+ color: "#00ff00"
94
+ image: numbers/one_9278045.png
95
+ cmd: echo "{id} {state}"
96
+ two:
97
+ color: "#00ff00"
98
+ image: numbers/two_9278103.png
99
+ cmd: echo "{id} {state}"
100
+ three:
101
+ color: "#00ff00"
102
+ image: numbers/three_9278150.png
103
+ cmd: echo "{id} {state}"
104
+ four:
105
+ color: "#00ff00"
106
+ image: numbers/four_9278183.png
107
+ cmd: echo "{id} {state}"
108
+ five:
109
+ color: "#00ff00"
110
+ image: numbers/five_9278222.png
111
+ cmd: echo "{id} {state}"
112
+ "4":
113
+ default: five
114
+ states:
115
+ off:
116
+ color: "#000099"
117
+ cmd: echo "{id} {state}"
118
+ one:
119
+ color: "#00ff00"
120
+ image: numbers/one_9278045.png
121
+ cmd: echo "{id} {state}"
122
+ two:
123
+ color: "#00ff00"
124
+ image: numbers/two_9278103.png
125
+ cmd: echo "{id} {state}"
126
+ three:
127
+ color: "#00ff00"
128
+ image: numbers/three_9278150.png
129
+ cmd: echo "{id} {state}"
130
+ four:
131
+ color: "#00ff00"
132
+ image: numbers/four_9278183.png
133
+ cmd: echo "{id} {state}"
134
+ five:
135
+ color: "#00ff00"
136
+ image: numbers/five_9278222.png
137
+ cmd: echo "{id} {state}"
138
+ "5":
139
+ states:
140
+ off:
141
+ color: "#000099"
142
+ cmd: echo "{id} {state}"
143
+ one:
144
+ color: "#00ff00"
145
+ image: numbers/one_9278045.png
146
+ cmd: echo "{id} {state}"
147
+ two:
148
+ color: "#00ff00"
149
+ image: numbers/two_9278103.png
150
+ cmd: echo "{id} {state}"
151
+ three:
152
+ color: "#00ff00"
153
+ image: numbers/three_9278150.png
154
+ cmd: echo "{id} {state}"
155
+ four:
156
+ color: "#00ff00"
157
+ image: numbers/four_9278183.png
158
+ cmd: echo "{id} {state}"
159
+ five:
160
+ color: "#00ff00"
161
+ image: numbers/five_9278222.png
162
+ cmd: echo "{id} {state}"
163
+ left:
164
+ "0":
165
+ states:
166
+ on:
167
+ color: "#000000"
168
+ cmd: echo "{id} {state}"
169
+ right:
170
+ "0":
171
+ states:
172
+ on:
173
+ color: "#000000"
174
+ cmd: echo "{id} {state}"
175
+ knobs:
176
+ knobTL:
177
+ states:
178
+ on:
179
+ cmd: echo "{id} {state}"
180
+ group: ""
181
+ knobCL:
182
+ states:
183
+ on:
184
+ cmd: echo "{id} {state}"
185
+ group: ""
186
+ knobBL:
187
+ states:
188
+ on:
189
+ cmd: echo "{id} {state}"
190
+ opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
191
+ blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
192
+ group: ""
193
+ knobTR:
194
+ states:
195
+ on:
196
+ cmd: echo "{id} {state}"
197
+ group: ""
198
+ knobCR:
199
+ states:
200
+ on:
201
+ cmd: echo "{id} {state}"
202
+ group: ""
203
+ knobBR:
204
+ states:
205
+ on:
206
+ cmd: echo "{id} {state}"
207
+ group: ""
208
+ parameters:
209
+ hostname: 127.0.0.1
210
+ simnbr: "1"
211
+ endpointurl: opc.tcp://{hostname}:4840
212
+ nodeid: ns=0;s=nodeID
213
+ verbose: true
package/test.mjs CHANGED
@@ -1,41 +1,41 @@
1
- import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
2
-
3
- var config='config.yaml'
4
-
5
- // Check if a config file exists
6
- import { existsSync } from 'fs'
7
- if (existsSync(config)) {
8
- console.log(`Using config file: ${config}`)
9
- } else if (existsSync(config.replace('.yaml', '.json'))) {
10
- // If a JSON config file exists, use it instead
11
- config = config.replace('.yaml', '.json')
12
- console.log(`Using config file: ${config}`)
13
- } else {
14
- // If no config file exists, exit with an error message
15
- console.error(`Config file ${config} does not exist. Please create it.`)
16
- process.exit(1)
17
- }
18
-
19
- /**
20
- * Initialize the Handler using a default config-File
21
- */
22
- const handler = new BaseLoupeDeckHandler(config)
23
-
24
- /**
25
- * Stop the handlers when a signal like SIGINT or SIGTERM arrive
26
- * @param {*} signal
27
- */
28
- const stopHandler = async(signal) => {
29
- console.log(`Receiving ${signal} => Stopping processes.`)
30
- await handler.stop()
31
- }
32
-
33
- // Initiating the signal handlers:
34
- // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
35
- process.on('SIGINT', async (signal) => { stopHandler(signal) })
36
- process.on('SIGTERM', async (signal) => { stopHandler(signal) })
37
-
38
-
39
- await handler.start()
40
-
1
+ import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
2
+
3
+ var config='config.yaml'
4
+
5
+ // Check if a config file exists
6
+ import { existsSync } from 'fs'
7
+ if (existsSync(config)) {
8
+ console.log(`Using config file: ${config}`)
9
+ } else if (existsSync(config.replace('.yaml', '.json'))) {
10
+ // If a JSON config file exists, use it instead
11
+ config = config.replace('.yaml', '.json')
12
+ console.log(`Using config file: ${config}`)
13
+ } else {
14
+ // If no config file exists, exit with an error message
15
+ console.error(`Config file ${config} does not exist. Please create it.`)
16
+ process.exit(1)
17
+ }
18
+
19
+ /**
20
+ * Initialize the Handler using a default config-File
21
+ */
22
+ const handler = new BaseLoupeDeckHandler(config)
23
+
24
+ /**
25
+ * Stop the handlers when a signal like SIGINT or SIGTERM arrive
26
+ * @param {*} signal
27
+ */
28
+ const stopHandler = async(signal) => {
29
+ console.log(`Receiving ${signal} => Stopping processes.`)
30
+ await handler.stop()
31
+ }
32
+
33
+ // Initiating the signal handlers:
34
+ // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
35
+ process.on('SIGINT', async (signal) => { stopHandler(signal) })
36
+ process.on('SIGTERM', async (signal) => { stopHandler(signal) })
37
+
38
+
39
+ await handler.start()
40
+
41
41
  await new Promise((resolve) => process.once("SIGINT", resolve));