loupedeck-commander 1.2.0 → 1.2.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,95 +0,0 @@
1
- import {
2
- OPCUAClient,
3
- BrowseDirection,
4
- AttributeIds,
5
- NodeClassMask,
6
- makeBrowsePath,
7
- resolveNodeId,
8
- TimestampsToReturn,
9
- coerceInt32,
10
- coerceByteString
11
- } from "node-opcua";
12
- import { BaseIf } from './baseif.mjs'
13
-
14
- var endpointUrl = "opc.tcp://localhost:4840";
15
- const subscriptionParameters = {
16
- maxNotificationsPerPublish: 1000,
17
- publishingEnabled: true,
18
- requestedLifetimeCount: 100,
19
- requestedMaxKeepAliveCount: 10,
20
- requestedPublishingInterval: 1000
21
- };
22
- var client
23
- var GlobalSession
24
- var GlobalSub
25
-
26
-
27
- async function Connect() {
28
- client = OPCUAClient.create({
29
- endpointMustExist: false
30
- });
31
- client.on("backoff", (retry, delay) =>
32
- console.log("still trying to connect to ", endpointUrl, ": retry =", retry, "next attempt in ", delay / 1000, "seconds")
33
- );
34
-
35
-
36
- //await client.connect(endpointUrl)
37
- var self=this
38
- await client.withSubscriptionAsync(endpointUrl, subscriptionParameters, async (session, subscription) => {
39
- GlobalSession = session
40
- GlobalSub = subscription
41
- console.log("Session initialized")
42
-
43
- // wait until CTRL+C is pressed
44
- console.log("CTRL+C to stop");
45
- await new Promise((resolve) => process.once("SIGINT", resolve));
46
- } )
47
- }
48
-
49
- async function Subscribe(nodeID) {
50
- // install monitored item
51
-
52
- nodeID = "ns=4;s=Is1.Kvm.in.Source"
53
- const itemToMonitor = {
54
- nodeId: resolveNodeId(nodeID),
55
- attributeId: AttributeIds.Value
56
- };
57
- const monitoringParameters = {
58
- samplingInterval: 100,
59
- discardOldest: true,
60
- queueSize: 10
61
- };
62
-
63
- const monitoredItem = await GlobalSub.monitor(itemToMonitor, monitoringParameters, TimestampsToReturn.Both);
64
- monitoredItem.on("changed", function (dataValue) {
65
- //console.log("monitored item changed: ", coerceInt32(dataValue.value.value), "bytes");
66
- console.log("monitored item changed: ", nodeID, dataValue.value.value);
67
- });
68
- }
69
-
70
- async function Read(nodeID) {
71
- if client
72
- const maxAge = 0;
73
- const nodeToRead = {
74
- nodeId: "ns=4;s=Is1.Kvm.in.Receiver",
75
- attributeId: AttributeIds.Value
76
- };
77
-
78
- const dataValue2 = await GlobalSession.read(nodeToRead, maxAge);
79
- console.log(" nodeID ",nodeID, dataValue2.toString());
80
- }
81
-
82
- Connect();
83
- //await Read("ns=4;s=Is1.Kvm.in.Receiver")
84
- await Subscribe("ns=4;s=Is1.Kvm.in.Receiver")
85
- await new Promise((resolve) => process.once("SIGINT", resolve));
86
-
87
-
88
- /**
89
- * Our Special-Handler just used the Default - and adds Vibration after triggers through Button-Releases
90
- */
91
- export class OPCUAIf extends BaseIf {
92
- async call (callString, options = {}) {
93
- }
94
- }
95
-
package/profile-2.json DELETED
@@ -1,164 +0,0 @@
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
- }