code: function(sensorInfo, options) {
    var gpioNum;
  
    if (sensorInfo.model) {
      this.model = sensorInfo.model;
    } else {
      if (options) {
        this.model = options.model;
      }
    }
    if (!options) { options = {}; }
  
    options.gpioPort = SWITCH_GPIO_NUM;
    gpioNum = Number(sensorInfo.device.address, 10);
  
    if (!_.isNaN(gpioNum)) {
      options.gpioPort = gpioNum;
    } else {
      console.warn('MotionDetector sensor address is not provided');
    }
  
    this.savedValue = 0;
  
    OnOff.call(this, sensorInfo, options, 'motion');
  }
docs: var MAX_COUNT_IN_GRACE_PERIOD = 10; MotionDetector (model: PassiveInfrared) constructor