lib/deviceloader.js
function DeviceLoader() {
  var self = this;

  // call super class
  EventEmitter2.call(this, {
    wildcard: true,
    delimiter: ':',
    maxListeners: 1000 // default would be 10!
  });

  if (this.log) {
    this.log = _.wrap(this.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
  } else if (DeviceLoader.prototype.log) {
    DeviceLoader.prototype.log = _.wrap(DeviceLoader.prototype.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
    this.log = DeviceLoader.prototype.log;
  } else {
    var debug = require('debug')(this.constructor.name);
    this.log = function(msg) {
      debug(msg);
    };
  }

  this.lookupIntervalId = null;
  this.oldDevices = [];

  this.isRunning = false;
}
function DeviceLoader() {
  var self = this;

  // call super class
  EventEmitter2.call(this, {
    wildcard: true,
    delimiter: ':',
    maxListeners: 1000 // default would be 10!
  });

  if (this.log) {
    this.log = _.wrap(this.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
  } else if (DeviceLoader.prototype.log) {
    DeviceLoader.prototype.log = _.wrap(DeviceLoader.prototype.log, function(func, msg) {
      func(self.constructor.name + ': ' + msg);
    });
    this.log = DeviceLoader.prototype.log;
  } else {
    var debug = require('debug')(this.constructor.name);
    this.log = function(msg) {
      debug(msg);
    };
  }

  this.lookupIntervalId = null;
  this.oldDevices = [];

  this.isRunning = false;
}
function DeviceLoader ( ) { var self = this ; // call super class EventEmitter2 . call ( this , { wildcard : true , delimiter : ':' , maxListeners : 1000 // default would be 10! } ) ; if ( this . log ) { this . log = _ . wrap ( this . log , function ( func , msg ) { func ( self . constructor . name + ': ' + msg ) ; } ) ; } else if ( DeviceLoader . prototype . log ) { DeviceLoader . prototype . log = _ . wrap ( DeviceLoader . prototype . log , function ( func , msg ) { func ( self . constructor . name + ': ' + msg ) ; } ) ; this . log = DeviceLoader . prototype . log ; } else { var debug = require ( 'debug' ) ( this . constructor . name ) ; this . log = function ( msg ) { debug ( msg ) ; } ; } this . lookupIntervalId = null ; this . oldDevices = [ ] ; this . isRunning = false ; }
A deviceloader can check if there are available some devices.
A deviceloader can check if there are available some devices .