node-red-contrib-hikvision-ultimate
Advanced tools
Comparing version 1.0.58 to 1.0.59
@@ -7,2 +7,6 @@ <p align="center"><img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-hikvision-ultimate/master/img/logo.png' width="40%"></p> | ||
<p> | ||
<b>Version 1.0.59</b> January 2022<br/> | ||
- FIX for some couple NVR/firmware, not behaving standard with the heartbeat.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.58</b> December 2021<br/> | ||
@@ -9,0 +13,0 @@ - FIX a possible error in wrong XML returned by the node, if node-red runs under IOBroker, having an old XML parser version.<br/> |
@@ -170,3 +170,3 @@ | ||
if (node.debug) RED.log.info("Doorbell-config: oReadable.on('data') " + chunk); | ||
if (chunk.endsWith("}")) { | ||
if (chunk.includes("}")) { | ||
try { | ||
@@ -173,0 +173,0 @@ handleChunk(chunk); |
@@ -193,3 +193,2 @@ | ||
if (node.debug) RED.log.error("BANANA ERRORE xml2js(sRet, function (err, result) " + error.message || ""); | ||
} | ||
@@ -269,12 +268,27 @@ | ||
if (result.indexOf("--boundary") > -1) { | ||
try { | ||
handleChunk(result); | ||
} catch (error) { | ||
if (node.debug) RED.log.info("Hikvision-config: Error handleChunk " + error.message || ""); | ||
} | ||
result = ""; | ||
// 11/01/2022 let's do some other checks on the event stream text | ||
let bMessageCanBeHandled = false; | ||
if (result.includes("</EventNotificationAlert>")) { | ||
// Is the XML | ||
bMessageCanBeHandled = true; | ||
} else if (result.includes("}")) { | ||
// Should be the JSON | ||
bMessageCanBeHandled = true; | ||
} | ||
if (bMessageCanBeHandled) { | ||
try { | ||
handleChunk(result); | ||
} catch (error) { | ||
if (node.debug) RED.log.info("Hikvision-config: Error handleChunk " + error.message || ""); | ||
} | ||
result = ""; | ||
} | ||
} | ||
}); | ||
oReadable.on('end', function () { | ||
// For some reason, some NVRs do end the stream. I must restart it. | ||
if (node.debug) RED.log.info("Hikvision-config: streamPipeline: STREAMING HAS ENDED."); | ||
startAlarmStream(); | ||
}); | ||
@@ -281,0 +295,0 @@ |
{ | ||
"name": "node-red-contrib-hikvision-ultimate", | ||
"version": "1.0.58", | ||
"version": "1.0.59", | ||
"description": "A native set of nodes for Hikvision (and compatible) Cameras, Alarms, Radars, NVR, Doorbells, etc.", | ||
@@ -8,4 +8,4 @@ "author": "Supergiovane (https://github.com/Supergiovane)", | ||
"xml2js": "0.4.23", | ||
"node-fetch": "2.6.1", | ||
"digest-fetch": "1.1.5", | ||
"node-fetch": "2.6.6", | ||
"digest-fetch": "1.2.1", | ||
"abort-controller": ">=3.0.0", | ||
@@ -12,0 +12,0 @@ "jimp": "0.16.1" |
Sorry, the diff of this file is not supported yet
2066877
2154
+ Addedcharenc@0.0.2(transitive)
+ Addedcrypt@0.0.2(transitive)
+ Addeddigest-fetch@1.2.1(transitive)
+ Addedis-buffer@1.1.6(transitive)
+ Addedmd5@2.3.0(transitive)
+ Addednode-fetch@2.6.6(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removedcrypto-js@3.3.0(transitive)
- Removeddigest-fetch@1.1.5(transitive)
- Removednode-fetch@2.6.1(transitive)
Updateddigest-fetch@1.2.1
Updatednode-fetch@2.6.6