dist/monitor-all.js
function(params, callback) {
      var t = this,
          connectError = false,
          monitors = t.get('monitors');

      if (t.get('started')) {
        var err = {code:'RUNNING', msg:'Cannot start - the recipe is already running.'};
        logger.warn(err);
        return callback(err);
      }

      // Called when a monitor has connected
      var onConnect = function(error) {
        if (connectError) {return;}
        if (error) {
          var err = {code:'CONNECT_ERROR', err: error};
          connectError = true;
          logger.error('start', err);
          return callback(err);
        }
        for (var name1 in t.monitors) {
          if (!t.monitors[name1].isConnected()) {
            return;
          }
        }
        t.set({started:true});
        t.connectListeners(true);
        callback();
      };

      // Connect all monitors
      for (var name2 in monitors) {
        t.monitors[name2] = new Monitor(monitors[name2]);
        t.monitors[name2].connect(onConnect);
      }

    }
function(params, callback) {
      var t = this,
          connectError = false,
          monitors = t.get('monitors');

      if (t.get('started')) {
        var err = {code:'RUNNING', msg:'Cannot start - the recipe is already running.'};
        logger.warn(err);
        return callback(err);
      }

      // Called when a monitor has connected
      var onConnect = function(error) {
        if (connectError) {return;}
        if (error) {
          var err = {code:'CONNECT_ERROR', err: error};
          connectError = true;
          logger.error('start', err);
          return callback(err);
        }
        for (var name1 in t.monitors) {
          if (!t.monitors[name1].isConnected()) {
            return;
          }
        }
        t.set({started:true});
        t.connectListeners(true);
        callback();
      };

      // Connect all monitors
      for (var name2 in monitors) {
        t.monitors[name2] = new Monitor(monitors[name2]);
        t.monitors[name2].connect(onConnect);
      }

    }
function ( params , callback ) { var t = this , connectError = false , monitors = t . get ( 'monitors' ) ; if ( t . get ( 'started' ) ) { var err = { code : 'RUNNING' , msg : 'Cannot start - the recipe is already running.' } ; logger . warn ( err ) ; return callback ( err ) ; } // Called when a monitor has connected var onConnect = function ( error ) { if ( connectError ) { return ; } if ( error ) { var err = { code : 'CONNECT_ERROR' , err : error } ; connectError = true ; logger . error ( 'start' , err ) ; return callback ( err ) ; } for ( var name1 in t . monitors ) { if ( ! t . monitors [ name1 ] . isConnected ( ) ) { return ; } } t . set ( { started : true } ) ; t . connectListeners ( true ) ; callback ( ) ; } ; // Connect all monitors for ( var name2 in monitors ) { t . monitors [ name2 ] = new Monitor ( monitors [ name2 ] ) ; t . monitors [ name2 ] . connect ( onConnect ) ; } }
Start the recipe

This connects to each monitor and sets up the recipe triggers

@method start_control
Start the recipe