node-red-contrib-hik-media-buffer 1.1.33 → 1.1.34
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/hik-media-buffer.js +10 -1
- package/package.json +1 -1
package/hik-media-buffer.js
CHANGED
|
@@ -245,9 +245,18 @@ module.exports = function(RED) {
|
|
|
245
245
|
if (data.includes("active")) {
|
|
246
246
|
const chMatch = data.match(/<channelid>(\d+)<\/channelid>/i);
|
|
247
247
|
if (chMatch) {
|
|
248
|
+
let channelID = chMatch[1];
|
|
249
|
+
|
|
250
|
+
// --- IL TUO CONTROLLO LOGICO ---
|
|
251
|
+
// Se l'host di ascolto coincide con l'IP della telecamera termica (canale 2)
|
|
252
|
+
// e la telecamera restituisce erroneamente canale 1, forziamo il canale a 2
|
|
253
|
+
const camTermica = node.cameras.find(c => c.channel == "2");
|
|
254
|
+
if (camTermica && node.host === camTermica.ip && channelID === "1") {
|
|
255
|
+
channelID = "2";
|
|
256
|
+
}
|
|
248
257
|
let ev = "Unknown";
|
|
249
258
|
for (let e of EventList) { if (data.includes(e.toLowerCase())) { ev = e; break; } }
|
|
250
|
-
downloadMedia(ev,
|
|
259
|
+
downloadMedia(ev, channelID);
|
|
251
260
|
}
|
|
252
261
|
}
|
|
253
262
|
});
|