Properly Fix #455 and lay new file for noEventsDetector

matrix-notifications^2
Moe 2023-01-31 10:13:31 -08:00
parent b6ae64acfe
commit 52d7a5a1de
3 changed files with 16 additions and 3 deletions

View File

@ -1,3 +1,4 @@
module.exports = function(s,config,lang){
require('./events/onvif.js')(s,config,lang)
require('./events/noEventsDetector.js')(s,config,lang)
}

View File

@ -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)
}
})
}

View File

@ -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