node-red-contrib-uos-nats 0.2.53 → 0.2.55
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-output.js +14 -1
- package/package.json +1 -1
package/nodes/datahub-output.js
CHANGED
|
@@ -84,7 +84,7 @@ module.exports = function (RED) {
|
|
|
84
84
|
id: nextId += 1,
|
|
85
85
|
key: normalized,
|
|
86
86
|
dataType,
|
|
87
|
-
access: '
|
|
87
|
+
access: 'READ_ONLY',
|
|
88
88
|
};
|
|
89
89
|
defMap.set(normalized, def);
|
|
90
90
|
definitions.push(def);
|
|
@@ -135,6 +135,13 @@ module.exports = function (RED) {
|
|
|
135
135
|
return;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
// Log heartbeat occasionally to prove aliveness
|
|
139
|
+
const nowMs = Date.now();
|
|
140
|
+
if (!this.lastHeartbeatLog || nowMs - this.lastHeartbeatLog > 10000) {
|
|
141
|
+
console.log(`[DataHub Output] Sending heartbeat for ${definitions.length} vars...`);
|
|
142
|
+
this.lastHeartbeatLog = nowMs;
|
|
143
|
+
}
|
|
144
|
+
|
|
138
145
|
const stateObj = {};
|
|
139
146
|
const nowNs = Date.now() * 1_000_000;
|
|
140
147
|
for (const s of stateMap.values()) {
|
|
@@ -174,6 +181,12 @@ module.exports = function (RED) {
|
|
|
174
181
|
sub = nc.subscribe(subjects.readVariablesQuery(this.providerId), {
|
|
175
182
|
callback: (err, msg) => {
|
|
176
183
|
if (err) {
|
|
184
|
+
// Suppress permission violation error as it's expected for some tokens
|
|
185
|
+
// and doesn't prevent pushing data.
|
|
186
|
+
if (err.message.includes('Permissions Violation')) {
|
|
187
|
+
this.trace(`Read request permission invalid (expected for push-only): ${err.message}`);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
177
190
|
this.warn(`Read request error: ${err.message}`);
|
|
178
191
|
return;
|
|
179
192
|
}
|
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.55",
|
|
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",
|