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.
package/profile-2.yaml CHANGED
@@ -1,215 +1,213 @@
1
- name: profile-1
2
- profile: example
3
- parameters:
4
- verbose: true
5
- description: ""
6
- touch:
7
- center:
8
- "0":
9
- default: one
10
- states:
11
- off:
12
- color: "#000099"
13
- cmd: echo "{id} {state}"
14
- one:
15
- color: "#00ff00"
16
- image: numbers/one_9278045.png
17
- cmd: echo "{id} {state}"
18
- two:
19
- color: "#00ff00"
20
- image: numbers/two_9278103.png
21
- cmd: echo "{id} {state}"
22
- three:
23
- color: "#00ff00"
24
- image: numbers/three_9278150.png
25
- cmd: echo "{id} {state}"
26
- four:
27
- color: "#00ff00"
28
- image: numbers/four_9278183.png
29
- cmd: echo "{id} {state}"
30
- five:
31
- color: "#00ff00"
32
- image: numbers/five_9278222.png
33
- cmd: echo "{id} {state}"
34
- "1":
35
- default: two
36
- params:
37
- nodeid: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
38
- states:
39
- off:
40
- color: "#000099"
41
- cmd: echo "{id} {state}"
42
- one:
43
- color: "#00ff00"
44
- image: numbers/one_9278045.png
45
- cmd: echo "{id} {state}"
46
- two:
47
- color: "#00ff00"
48
- image: numbers/two_9278103.png
49
- cmd: echo "{id} {state}"
50
- three:
51
- color: "#00ff00"
52
- image: numbers/three_9278150.png
53
- cmd: echo "{id} {state}"
54
- four:
55
- color: "#00ff00"
56
- image: numbers/four_9278183.png
57
- cmd: echo "{id} {state}"
58
- five:
59
- color: "#00ff00"
60
- image: numbers/five_9278222.png
61
- cmd: echo "{id} {state}"
62
- "2":
63
- default: three
64
- states:
65
- off:
66
- color: "#000099"
67
- cmd: echo "{id} {state}"
68
- one:
69
- color: "#00ff00"
70
- image: numbers/one_9278045.png
71
- cmd: echo "{id} {state}"
72
- two:
73
- color: "#00ff00"
74
- image: numbers/two_9278103.png
75
- cmd: echo "{id} {state}"
76
- three:
77
- color: "#00ff00"
78
- image: numbers/three_9278150.png
79
- cmd: echo "{id} {state}"
80
- four:
81
- color: "#00ff00"
82
- image: numbers/four_9278183.png
83
- cmd: echo "{id} {state}"
84
- five:
85
- color: "#00ff00"
86
- image: numbers/five_9278222.png
87
- cmd: echo "{id} {state}"
88
- "3":
89
- default: four
90
- states:
91
- off:
92
- color: "#000099"
93
- cmd: echo "{id} {state}"
94
- one:
95
- color: "#00ff00"
96
- image: numbers/one_9278045.png
97
- cmd: echo "{id} {state}"
98
- two:
99
- color: "#00ff00"
100
- image: numbers/two_9278103.png
101
- cmd: echo "{id} {state}"
102
- three:
103
- color: "#00ff00"
104
- image: numbers/three_9278150.png
105
- cmd: echo "{id} {state}"
106
- four:
107
- color: "#00ff00"
108
- image: numbers/four_9278183.png
109
- cmd: echo "{id} {state}"
110
- five:
111
- color: "#00ff00"
112
- image: numbers/five_9278222.png
113
- cmd: echo "{id} {state}"
114
- "4":
115
- default: five
116
- states:
117
- off:
118
- color: "#000099"
119
- cmd: echo "{id} {state}"
120
- one:
121
- color: "#00ff00"
122
- image: numbers/one_9278045.png
123
- cmd: echo "{id} {state}"
124
- two:
125
- color: "#00ff00"
126
- image: numbers/two_9278103.png
127
- cmd: echo "{id} {state}"
128
- three:
129
- color: "#00ff00"
130
- image: numbers/three_9278150.png
131
- cmd: echo "{id} {state}"
132
- four:
133
- color: "#00ff00"
134
- image: numbers/four_9278183.png
135
- cmd: echo "{id} {state}"
136
- five:
137
- color: "#00ff00"
138
- image: numbers/five_9278222.png
139
- cmd: echo "{id} {state}"
140
- "5":
141
- states:
142
- off:
143
- color: "#000099"
144
- cmd: echo "{id} {state}"
145
- one:
146
- color: "#00ff00"
147
- image: numbers/one_9278045.png
148
- cmd: echo "{id} {state}"
149
- two:
150
- color: "#00ff00"
151
- image: numbers/two_9278103.png
152
- cmd: echo "{id} {state}"
153
- three:
154
- color: "#00ff00"
155
- image: numbers/three_9278150.png
156
- cmd: echo "{id} {state}"
157
- four:
158
- color: "#00ff00"
159
- image: numbers/four_9278183.png
160
- cmd: echo "{id} {state}"
161
- five:
162
- color: "#00ff00"
163
- image: numbers/five_9278222.png
164
- cmd: echo "{id} {state}"
165
- left:
166
- "0":
167
- states:
168
- on:
169
- color: "#000000"
170
- cmd: echo "{id} {state}"
171
- right:
172
- "0":
173
- states:
174
- on:
175
- color: "#000000"
176
- cmd: echo "{id} {state}"
177
- knobs:
178
- knobTL:
179
- states:
180
- on:
181
- cmd: echo "{id} {state}"
182
- group: ""
183
- knobCL:
184
- states:
185
- on:
186
- cmd: echo "{id} {state}"
187
- group: ""
188
- knobBL:
189
- states:
190
- on:
191
- cmd: echo "{id} {state}"
192
- opcua: ns=2;s=DRV.AAFHR.compOut.FeldTempGetriebeoel
193
- blink: ns=2;s=DRV.AAFHR.compOut.Feststellbremse
194
- group: ""
195
- knobTR:
196
- states:
197
- on:
198
- cmd: echo "{id} {state}"
199
- group: ""
200
- knobCR:
201
- states:
202
- on:
203
- cmd: echo "{id} {state}"
204
- group: ""
205
- knobBR:
206
- states:
207
- on:
208
- cmd: echo "{id} {state}"
209
- group: ""
210
- parameters:
211
- hostname: 127.0.0.1
212
- simnbr: "1"
213
- endpointurl: opc.tcp://{hostname}:4840
214
- nodeid: ns=0;s=nodeID
215
- 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));