node-red-contrib-hikvision-ultimate
Advanced tools
Comparing version 1.0.25 to 1.0.26
@@ -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.26</b> January 2021<br/> | ||
- Fixed an unwanted LOG in case you have a picture node asking for an image to an unconnected camera.<br/> | ||
</p> | ||
<p> | ||
<b>Version 1.0.25</b> January 2021<br/> | ||
@@ -9,0 +13,0 @@ - Minor fixes in alarm filter.<br/> |
@@ -231,3 +231,3 @@ | ||
if (response.status >= 200 && response.status <= 300) { | ||
node.setAllClientsStatus({ fill: "green", shape: "ring", text: "Waiting for Alarm." }); | ||
node.setAllClientsStatus({ fill: "green", shape: "ring", text: "Waiting for event." }); | ||
} else { | ||
@@ -325,3 +325,3 @@ node.setAllClientsStatus({ fill: "red", shape: "ring", text: response.statusText || " unknown response code" }); | ||
} else if (_URL.toLowerCase().includes("/streaming/")) { | ||
body = await response.buffer(); // "data:image/png;base64," + | ||
body = await response.buffer(); // "data:image/png;base64," + | ||
//_callerNode.sendPayload({ topic: _callerNode.topic || "", payload: body.toString("base64")}); | ||
@@ -335,9 +335,12 @@ _callerNode.sendPayload({ topic: _callerNode.topic || "", payload: body }); | ||
// Main Error | ||
_callerNode.setNodeStatus({ fill: "grey", shape: "ring", text: "Horror: " + err.message }); | ||
_callerNode.setNodeStatus({ fill: "grey", shape: "ring", text: "clientGenericRequest.fetch error: " + err.message }); | ||
_callerNode.sendPayload({ topic: _callerNode.topic || "", errorDescription: err.message, payload: true }); | ||
if (node.debug) RED.log.error("Hikvision-config: clientGenericRequest.fetch error " + err.message); | ||
// Abort request | ||
try { | ||
if (reqController !== null) reqController.abort().then(ok => { }).catch(err => { }); | ||
} catch (error) { } | ||
throw (err); | ||
if (reqController !== null) { | ||
try { | ||
//if (reqController !== null) reqController.abort().then(ok => { }).catch(err => { }); | ||
reqController.abort(); | ||
} catch (error) { } | ||
} | ||
} | ||
@@ -344,0 +347,0 @@ }; |
@@ -111,4 +111,5 @@ | ||
switch (_msg.payload.CIDEvent.code.toString().toLowerCase()) { | ||
// Standard SIA Code is _msg.payload.CIDEvent.standardCIDcode | ||
case "1103": | ||
// Start alarm. Standard SIA Code is _msg.payload.CIDEvent.standardCIDcode: 1130 | ||
// Bulgary alarm | ||
oRetMsg.payload = true; | ||
@@ -118,9 +119,24 @@ node.setNodeStatus({ fill: "red", shape: "ring", text: "Zone " + oRetMsg.zone + " pre alert" }); | ||
case "3103": | ||
// End alarm. Standard SIA Code is _msg.payload.CIDEvent.standardCIDcode: 3130 | ||
// End Bulgary alarm. | ||
oRetMsg.payload = false; | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "Zone " + oRetMsg.zone + " normal" }); | ||
break; | ||
case "1148": | ||
// Motion Alarm start (The radar has been moved). | ||
node.setNodeStatus({ fill: "red", shape: "dot", text: "Device motion alarm" }); | ||
break; | ||
case "3148": | ||
// Motion Alarm end. | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "Device motion restored" }); | ||
break; | ||
case "3148": | ||
// Radar armed. | ||
node.setNodeStatus({ fill: "green", shape: "dot", text: "Radar armed" }); | ||
break; | ||
case "1401": | ||
// Radar armed. | ||
node.setNodeStatus({ fill: "red", shape: "dot", text: "Radar disarmed" }); | ||
break; | ||
default: | ||
// Unknown CID code. | ||
oRetMsg.payload = null; | ||
node.setNodeStatus({ fill: "grey", shape: "ring", text: "Zone " + oRetMsg.zone + " unknowk CID code " + _msg.payload.CIDEvent.code }); | ||
@@ -127,0 +143,0 @@ return; // Unknown state |
{ | ||
"name": "node-red-contrib-hikvision-ultimate", | ||
"version": "1.0.25", | ||
"version": "1.0.26", | ||
"description": "A native set of nodes for Hikvision Cameras, Alarms, Radars etc.", | ||
@@ -5,0 +5,0 @@ "author": "Supergiovane (https://github.com/Supergiovane)", |
Sorry, the diff of this file is not supported yet
1236730
1241