Properly Fix #455 and lay new file for noEventsDetector
parent
b6ae64acfe
commit
52d7a5a1de
|
@ -1,3 +1,4 @@
|
|||
module.exports = function(s,config,lang){
|
||||
require('./events/onvif.js')(s,config,lang)
|
||||
require('./events/noEventsDetector.js')(s,config,lang)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
module.exports = function(s,config,lang){
|
||||
const {
|
||||
setNoEventsDetector,
|
||||
} = require('../monitor/utils.js')(s,config,lang);
|
||||
|
||||
s.onEventTrigger((d,filter) => {
|
||||
const groupKey = d.ke
|
||||
const monitorId = d.mid || d.id
|
||||
const monitorConfig = s.group[groupKey].rawMonitorConfigurations[monitorId]
|
||||
const monitorDetails = monitorConfig.details
|
||||
if(monitorDetails.detector === '1' && monitorDetails.detector_notrigger === '1'){
|
||||
setNoEventsDetector(monitorConfig)
|
||||
}
|
||||
})
|
||||
}
|
|
@ -414,9 +414,6 @@ module.exports = (s,config,lang,app,io) => {
|
|||
}
|
||||
})
|
||||
}
|
||||
if(monitorDetails.detector === '1' && monitorDetails.detector_notrigger === '1'){
|
||||
s.setNoEventsDetector(monitorConfig)
|
||||
}
|
||||
var detector_timeout
|
||||
if(!monitorDetails.detector_timeout||monitorDetails.detector_timeout===''){
|
||||
detector_timeout = 10
|
||||
|
|
Loading…
Reference in New Issue