node-red-contrib-uos-nats 0.2.6 → 0.2.8
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/lib/payloads.js +5 -2
- package/nodes/datahub-input.html +1 -1
- package/nodes/datahub-output.html +1 -1
- package/nodes/datahub-write.html +3 -11
- package/package.json +1 -1
package/lib/payloads.js
CHANGED
|
@@ -79,7 +79,9 @@ export function buildReadProviderDefinitionQuery() {
|
|
|
79
79
|
// Encode write variables command
|
|
80
80
|
export function encodeWriteVariablesCommand(variables) {
|
|
81
81
|
// variables: [{id: number, value: any}, ...]
|
|
82
|
-
|
|
82
|
+
// variables: [{id: number, value: any}, ...]
|
|
83
|
+
// VariableListT constructor: fingerprint, baseTimestamp, items
|
|
84
|
+
const varList = new VariableListT(BigInt(0), null, []);
|
|
83
85
|
varList.items = variables.map(v => {
|
|
84
86
|
const varT = new VariableT();
|
|
85
87
|
varT.id = v.id;
|
|
@@ -211,7 +213,8 @@ export function decodeProviderDefinition(bb) {
|
|
|
211
213
|
}
|
|
212
214
|
function buildVariableList(defs, states, fingerprint) {
|
|
213
215
|
const variables = defs.map((def) => encodeVariableState(def, states[def.id]));
|
|
214
|
-
|
|
216
|
+
// Constructor: fingerprint, baseTimestamp (null), items
|
|
217
|
+
const list = new VariableListT(fingerprint, null, variables);
|
|
215
218
|
return list;
|
|
216
219
|
}
|
|
217
220
|
function encodeVariableState(def, state) {
|
package/nodes/datahub-input.html
CHANGED
package/nodes/datahub-write.html
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
2
|
RED.nodes.registerType('datahub-write', {
|
|
3
|
-
category: '
|
|
3
|
+
category: 'Weidmueller DataHub',
|
|
4
4
|
color: '#ff9900',
|
|
5
5
|
defaults: {
|
|
6
6
|
name: { value: "" },
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
outputs: 1,
|
|
14
14
|
icon: "white/datahub-write.svg",
|
|
15
15
|
label: function () {
|
|
16
|
-
|
|
17
|
-
const target = this.variableKey || this.variableId || 'var';
|
|
18
|
-
return `Write → ${this.providerId}:${target}`;
|
|
16
|
+
return this.name || "DataHub - Write";
|
|
19
17
|
},
|
|
20
18
|
paletteLabel: "DataHub - Write",
|
|
21
19
|
oneditprepare: function () {
|
|
@@ -35,13 +33,7 @@
|
|
|
35
33
|
$('#node-input-variableId, #node-input-variableKey').on('change keyup', validateVar);
|
|
36
34
|
},
|
|
37
35
|
oneditsave: function () {
|
|
38
|
-
//
|
|
39
|
-
const hasId = this.variableId;
|
|
40
|
-
const hasKey = this.variableKey;
|
|
41
|
-
if (!hasId && !hasKey) {
|
|
42
|
-
alert('Please provide either Variable ID or Variable Key');
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
36
|
+
// Loose validation - server side will check
|
|
45
37
|
}
|
|
46
38
|
});
|
|
47
39
|
</script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-uos-nats",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Node-RED nodes for Weidmüller u-OS Data Hub. Read, write, and provide variables via NATS protocol with OAuth2 authentication. Features: Variable Key resolution, custom icons, example flows, and provider definition caching.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "IoTUeli",
|