node-red-contrib-uos-nats 1.3.0 → 1.3.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/nodes/datahub-input.js +3 -2
- package/nodes/datahub-write.js +8 -2
- package/package.json +1 -1
package/nodes/datahub-input.js
CHANGED
|
@@ -156,7 +156,8 @@ module.exports = function (RED) {
|
|
|
156
156
|
|
|
157
157
|
if ((defMap.size === 0 && this.manualDefs.length === 0) || hasMissingIds) {
|
|
158
158
|
try {
|
|
159
|
-
|
|
159
|
+
// Changed from warn to debug to reduce noise as per user request
|
|
160
|
+
this.debug(hasMissingIds
|
|
160
161
|
? `Loaded variables have unresolved IDs (Heuristic). Attempting NATS Discovery to resolve real IDs for ${this.providerId}...`
|
|
161
162
|
: `Attempting NATS Discovery (Direct) for ${this.providerId}...`
|
|
162
163
|
);
|
|
@@ -171,7 +172,7 @@ module.exports = function (RED) {
|
|
|
171
172
|
const defs = payloads.decodeProviderDefinition(defMsg.data);
|
|
172
173
|
|
|
173
174
|
if (defs && defs.variables.length > 0) {
|
|
174
|
-
this.
|
|
175
|
+
this.debug(`NATS Discovery Successful: Received ${defs.variables.length} definitions with real IDs.`);
|
|
175
176
|
// Overwrite/Update defMap
|
|
176
177
|
// Logic: Match by KEY. DataHub providers should have unique keys.
|
|
177
178
|
// If we have existing "fake" ID 5 for "temp", and NATS says "temp" is ID 291.
|
package/nodes/datahub-write.js
CHANGED
|
@@ -111,14 +111,20 @@ module.exports = function (RED) {
|
|
|
111
111
|
if (this.variableKey) {
|
|
112
112
|
// Trigger background resolution
|
|
113
113
|
node.status({ fill: 'yellow', shape: 'dot', text: 'resolving...' });
|
|
114
|
-
|
|
114
|
+
// Trigger background resolution
|
|
115
|
+
node.status({ fill: 'yellow', shape: 'dot', text: 'resolving...' });
|
|
116
|
+
|
|
117
|
+
// Fix: Cannot use await in constructor. Use Promise chain.
|
|
118
|
+
configNode.acquire().then(nc => {
|
|
119
|
+
return resolveVariableKey(nc, node.providerId, node.variableKey, node, node.payloads);
|
|
120
|
+
})
|
|
115
121
|
.then(resolved => {
|
|
116
122
|
node.resolvedId = resolved.id;
|
|
117
123
|
node.resolvedDataType = resolved.dataType;
|
|
118
124
|
node.resolvedFingerprint = resolved.fingerprint;
|
|
119
125
|
|
|
120
126
|
if (node.variableId && node.variableId !== resolved.id) {
|
|
121
|
-
node.
|
|
127
|
+
node.debug(`Auto-Healed ID for '${this.variableKey}': Configured=${node.variableId}, Resolved=${resolved.id}`);
|
|
122
128
|
}
|
|
123
129
|
node.status({ fill: 'green', shape: 'ring', text: 'ready' });
|
|
124
130
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-uos-nats",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
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",
|