node-red-contrib-hik-media-buffer 1.1.34 → 1.1.35
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 +5 -2
- package/package.json +1 -1
package/hik-media-buffer.js
CHANGED
|
@@ -27,7 +27,8 @@ module.exports = function(RED) {
|
|
|
27
27
|
let statoCamera = {};
|
|
28
28
|
|
|
29
29
|
const httpsAgent = new https.Agent({ rejectUnauthorized: false });
|
|
30
|
-
const
|
|
30
|
+
const EventListNVR = ["FieldDetection", "LineDetection"];
|
|
31
|
+
const EventListCAM = ["fielddetection", "linedetection"];
|
|
31
32
|
|
|
32
33
|
// CARTELLA TEMPORANEA
|
|
33
34
|
const baseStorage = path.join(os.tmpdir(), "hik_temp_media");
|
|
@@ -246,6 +247,7 @@ module.exports = function(RED) {
|
|
|
246
247
|
const chMatch = data.match(/<channelid>(\d+)<\/channelid>/i);
|
|
247
248
|
if (chMatch) {
|
|
248
249
|
let channelID = chMatch[1];
|
|
250
|
+
let currentEventList = EventListNVR;
|
|
249
251
|
|
|
250
252
|
// --- IL TUO CONTROLLO LOGICO ---
|
|
251
253
|
// Se l'host di ascolto coincide con l'IP della telecamera termica (canale 2)
|
|
@@ -253,9 +255,10 @@ module.exports = function(RED) {
|
|
|
253
255
|
const camTermica = node.cameras.find(c => c.channel == "2");
|
|
254
256
|
if (camTermica && node.host === camTermica.ip && channelID === "1") {
|
|
255
257
|
channelID = "2";
|
|
258
|
+
currentEventList = EventListCAM;
|
|
256
259
|
}
|
|
257
260
|
let ev = "Unknown";
|
|
258
|
-
for (let e of
|
|
261
|
+
for (let e of currentEventList) { if (data.includes(e.toLowerCase())) { ev = e; break; } }
|
|
259
262
|
downloadMedia(ev, channelID);
|
|
260
263
|
}
|
|
261
264
|
}
|