main.js
function GetMotionDetector (name) {
  // It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency
  console.log("Attention! this function GetMotionDetectors returns a singleton of motion detectors! If you are running several instances only one instance prevails!");
  return _.filter(motionDetectors, x => x.name === name)[0]
  // Another alternative way: lodash.filter(motionDetectors, { 'name': 'Something' } );
}
function GetMotionDetector (name) {
  // It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency
  console.log("Attention! this function GetMotionDetectors returns a singleton of motion detectors! If you are running several instances only one instance prevails!");
  return _.filter(motionDetectors, x => x.name === name)[0]
  // Another alternative way: lodash.filter(motionDetectors, { 'name': 'Something' } );
}
function GetMotionDetector ( name ) { // It's assumed the number of motion detectors will be sufficiently small to be ok to iterate without major loss of efficiency console . log ( "Attention! this function GetMotionDetectors returns a singleton of motion detectors! If you are running several instances only one instance prevails!" ) ; return _ . filter ( motionDetectors , x => x . name === name ) [ 0 ] // Another alternative way: lodash.filter(motionDetectors, { 'name': 'Something' } ); }
Gets the Motion Detectors with the given name.
Will throw an exception if there is no Motion detector with such name.
@param {string} name is the name of the MotionDetector instance to get.
@returns a MotionDetector objects.
Attention! motion detectors is a singleton!
@public
Gets the Motion Detectors with the given name . Will throw an exception if there is no Motion detector with such name .