From 157830022586bd89cad1dacd7c7ad266c0f2f9d6 Mon Sep 17 00:00:00 2001 From: Ian Rubado <irubado@titan.hoppinmarsh.com> Date: Thu, 28 Oct 2021 15:37:15 -0400 Subject: [PATCH] Logic fix for object detection and motion. Allows for motion first to work with yes and no. Logic fix for object detection and motion. Allows for motion first to work with yes and no. --- libs/monitor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/monitor.js b/libs/monitor.js index dc469b6e..0d57dbb4 100644 --- a/libs/monitor.js +++ b/libs/monitor.js @@ -950,11 +950,15 @@ module.exports = function(s,config,lang){ console.log(err) } }) - if(e.details.detector_use_detect_object === '1'){ + if(e.details.detector_use_detect_object === '1' && e.details.detector_use_motion === '1' ){ s.group[e.ke].activeMonitors[e.id].spawn.stdio[4].on('data',function(data){ onDetectorJpegOutputSecondary(e,data) }) - } + }else{ + s.group[e.ke].activeMonitors[e.id].spawn.stdio[4].on('data',function(data){ + onDetectorJpegOutputAlone(e,data) + }) + } }else if(e.details.detector_use_detect_object === '1' && e.details.detector_send_frames !== '1'){ s.group[e.ke].activeMonitors[e.id].spawn.stdio[4].on('data',function(data){ onDetectorJpegOutputSecondary(e,data)