node-red-contrib-uos-nats 0.2.37 → 0.2.38
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 +9 -3
- package/package.json +1 -1
package/nodes/datahub-output.js
CHANGED
|
@@ -121,11 +121,17 @@ module.exports = function (RED) {
|
|
|
121
121
|
let loadedSubjects = null;
|
|
122
122
|
|
|
123
123
|
const sendValuesUpdate = async () => {
|
|
124
|
-
if (!nc || nc.isClosed())
|
|
124
|
+
if (!nc || nc.isClosed()) {
|
|
125
|
+
console.log('[DataHub Output] Heartbeat skipped: NATS closed or missing.');
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
125
128
|
if (!loadedPayloads || !loadedSubjects) return;
|
|
126
129
|
|
|
127
130
|
// If we have no definitions yet, nothing to send
|
|
128
|
-
if (definitions.length === 0)
|
|
131
|
+
if (definitions.length === 0) {
|
|
132
|
+
console.log('[DataHub Output] Heartbeat skipped: No definitions.');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
129
135
|
|
|
130
136
|
const stateObj = {};
|
|
131
137
|
for (const s of stateMap.values()) {
|
|
@@ -134,7 +140,7 @@ module.exports = function (RED) {
|
|
|
134
140
|
try {
|
|
135
141
|
const payload = loadedPayloads.buildVariablesChangedEvent(definitions, stateObj, fingerprint);
|
|
136
142
|
await nc.publish(loadedSubjects.varsChangedEvent(this.providerId), payload);
|
|
137
|
-
|
|
143
|
+
console.log(`[DataHub Output] Heartbeat sent. State count: ${Object.keys(stateObj).length}`);
|
|
138
144
|
} catch (err) {
|
|
139
145
|
this.warn(`Heartbeat error: ${err.message}`);
|
|
140
146
|
}
|
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.38",
|
|
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",
|