loupedeck-commander 1.0.2 → 1.2.0

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.json ADDED
@@ -0,0 +1,164 @@
1
+ {
2
+ "profile": "sample",
3
+ "parameters": {
4
+ "hostname": "localhost",
5
+ "user": "httpuser",
6
+ "password": "httppasswd",
7
+ "verbose" : false,
8
+ "endpointurl": "opc.tcp://localhost:4840",
9
+ "nodeid" : "ns=4;s=Is{simnbr}.Kvm.in.Source",
10
+ "value" : "kvm-transmitter-1",
11
+ "simnbr": "1"
12
+ },
13
+ "description": "",
14
+ "config": {},
15
+ "touch": {
16
+ "left": {},
17
+ "right": {},
18
+ "center": {
19
+ "0": {
20
+ "states": {
21
+ "off": {
22
+ "color": "#aaaaaa",
23
+ "image": "icons/home.png"
24
+ },
25
+ "on": {
26
+ "color": "#11ff11",
27
+ "image": "icons/home.png",
28
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.in.Source",
29
+ "value": "kvm-transmitter{key}-1"
30
+ }
31
+ },
32
+ "nodeid": "ns=4;s=Is{simnbr}.Kvm.out.Source",
33
+ "group": "kvm1"
34
+ },
35
+ "1": {
36
+ "states": {
37
+ "off": {
38
+ "color": "#aaaaaa",
39
+ "image": "icons/bulb.png"
40
+ },
41
+ "on": {
42
+ "color": "#11ff11",
43
+ "image": "icons/bulb.png",
44
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.in.Source",
45
+ "value": "kvm-transmitter{key}-1"
46
+ }
47
+ },
48
+ "nodeid": "ns=4;s=Is{simnbr}.Kvm.out.Source",
49
+ "group": "kvm1"
50
+ },
51
+ "2": {
52
+ "states": {
53
+ "off": {
54
+ "color": "#aaaaaa",
55
+ "image": "icons/mountain.png"
56
+ },
57
+ "on": {
58
+ "color": "#11ff11",
59
+ "image": "icons/mountain.png",
60
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.in.Source",
61
+ "value": "kvm-transmitter{key}-1"
62
+ }
63
+ },
64
+ "nodeid": "ns=4;s=Is{simnbr}.Kvm.out.Source",
65
+ "group": "kvm1"
66
+ },
67
+ "3": {
68
+ "states": {
69
+ "off": {
70
+ "color": "#aaaaaa",
71
+ "image": "icons/mountain.png"
72
+ },
73
+ "on": {
74
+ "color": "#11ff11",
75
+ "image": "icons/mountain.png",
76
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.in.Source",
77
+ "value": "kvm-transmitter{key}-1"
78
+ }
79
+ },
80
+ "nodeid": "ns=4;s=Is{simnbr}.Kvm.out.Source",
81
+ "group": "kvm1"
82
+ },
83
+ "4": {
84
+ "states": {
85
+ "off": {
86
+ "color": "#aaaaaa",
87
+ "image": "icons/mountain.png"
88
+ },
89
+ "on": {
90
+ "color": "#11ff11",
91
+ "image": "icons/mountain.png",
92
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.in.Source",
93
+ "value": "kvm-transmitter{key}-1"
94
+ }
95
+ },
96
+ "nodeid": "ns=4;s=Is{simnbr}.Kvm.out.Source",
97
+ "group": "kvm1"
98
+ }
99
+ },
100
+ "knob": {}
101
+ },
102
+ "knobs": {
103
+ "left": {},
104
+ "right": {}
105
+ },
106
+ "buttons": {
107
+ "1": {
108
+ "states": {
109
+ "off": {
110
+ "color": "#aaaaaa"
111
+ },
112
+ "on": {
113
+ "color": "#11ff11",
114
+ "http": "http://{hostname}:7778/control/connections",
115
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.out.Source",
116
+ "value": "kvm-transmitter{key}-1"
117
+ }
118
+ },
119
+ "group": "kvm1"
120
+ },
121
+ "2": {
122
+ "states": {
123
+ "off": {
124
+ "color": "#aaaaaa"
125
+ },
126
+ "on": {
127
+ "color": "#11ff11",
128
+ "http": "http://{hostname}:7778/control/connections",
129
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.out.Source",
130
+ "value": "kvm-transmitter{key}-1"
131
+ }
132
+ },
133
+ "group": "kvm1"
134
+ },
135
+ "3": {
136
+ "states": {
137
+ "off": {
138
+ "color": "#aaaaaa"
139
+ },
140
+ "on": {
141
+ "color": "#11ff11",
142
+ "http": "http://{hostname}:7778/control/connections",
143
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.out.Source",
144
+ "value": "kvm-transmitter{key}-1"
145
+ }
146
+ },
147
+ "group": "kvm1"
148
+ },
149
+ "4": {
150
+ "states": {
151
+ "off": {
152
+ "color": "#aaaaaa"
153
+ },
154
+ "on": {
155
+ "color": "#11ff11",
156
+ "http": "http://{hostname}:7778/control/connections",
157
+ "opcua": "ns=4;s=Is{simnbr}.Kvm.out.Source",
158
+ "value": "kvm-transmitter{key}-1"
159
+ }
160
+ },
161
+ "group": "kvm1"
162
+ }
163
+ }
164
+ }
package/test.mjs ADDED
@@ -0,0 +1,23 @@
1
+ import { BaseLoupeDeckHandler } from './common/BaseLoupeDeckHandler.mjs'
2
+ //import { BaseLoupeDeckHandler } from 'loupedeck-commander'
3
+
4
+ const handler = new BaseLoupeDeckHandler('config-test.json')
5
+
6
+ /**
7
+ * Stop the handlers when a signal like SIGINT or SIGTERM arrive
8
+ * @param {*} signal
9
+ */
10
+ const stopHandler = async(signal) => {
11
+ console.log(`Receiving ${signal} => Stopping processes.`)
12
+ await handler.stop()
13
+ }
14
+
15
+ // Initiating the signal handlers:
16
+ // see https://www.tutorialspoint.com/unix/unix-signals-traps.htm
17
+ process.on('SIGINT', async (signal) => { stopHandler(signal) })
18
+ process.on('SIGTERM', async (signal) => { stopHandler(signal) })
19
+
20
+
21
+ await handler.start()
22
+
23
+ await new Promise((resolve) => process.once("SIGINT", resolve));