Auto start by default
This commit is contained in:
parent
f1544e5a8f
commit
021c1756dc
|
@ -0,0 +1,15 @@
|
|||
var Cylon = require('cylon');
|
||||
|
||||
var robot = new Cylon.Robot({
|
||||
connection: { name: 'loopback', adaptor: 'loopback' },
|
||||
device: { name: 'ping', driver: 'ping' },
|
||||
});
|
||||
|
||||
setInterval(function() {
|
||||
console.log("Hello, human!")
|
||||
console.log(robot.ping.ping());
|
||||
}, 1000);
|
||||
|
||||
setTimeout(function() {
|
||||
console.log("I've been at your command for 5 seconds now.")
|
||||
}, 5000);
|
|
@ -120,6 +120,12 @@ var Robot = module.exports = function Robot(opts) {
|
|||
this.commands = opts.commands;
|
||||
}
|
||||
|
||||
|
||||
var auto_start = Config.auto_start || true;
|
||||
|
||||
if (true) {
|
||||
this.start();
|
||||
}
|
||||
};
|
||||
|
||||
Utils.subclass(Robot, EventEmitter);
|
||||
|
@ -249,6 +255,7 @@ Robot.prototype.start = function() {
|
|||
Logger.fatal(err);
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
// Public: Starts the Robot's connections and triggers a callback
|
||||
|
|
Loading…
Reference in New Issue