diff --git a/lib/Client.js b/lib/Client.js index b00fbe7..839aec1 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -53,7 +53,6 @@ Client.prototype.resume = function() { this._udpNavdatasStream .on('error', this._maybeEmitError.bind(this)) .on('data', this._handleNavdata.bind(this)); - return this; }; Client.prototype._handleNavdata = function(navdata) { @@ -135,39 +134,30 @@ Client.prototype._sendCommands = function() { Client.prototype.disableEmergency = function() { this._disableEmergency = true; - return this; }; Client.prototype.takeoff = function() { this._ref.fly = true; - return this; + return true; }; Client.prototype.land = function() { this._ref.fly = false; - return this; + return true; }; Client.prototype.stop = function() { this._pcmd = {}; - return this; + return true; }; Client.prototype.config = function(key, value) { - if (typeof key === "object") { - for (var k in key) { - if (Object.hasOwnProperty.call(key, k)) this.config(k, key[k]); - } - return this; - } - // @TODO Figure out if we can get a ACK for this, so we don't need to // repeat it blindly like this var self = this; this._repeat(10, function() { self._udpControl.config(key, value); }); - return this; }; Client.prototype.animate = function(animation, duration) { @@ -177,7 +167,6 @@ Client.prototype.animate = function(animation, duration) { this._repeat(10, function() { self._udpControl.animate(animation, duration); }); - return this; }; Client.prototype.animateLeds = function(animation, hz, duration) { @@ -187,7 +176,6 @@ Client.prototype.animateLeds = function(animation, hz, duration) { this._repeat(10, function() { self._udpControl.animateLeds(animation, hz, duration); }); - return this; }; Client.prototype._repeat = function(times, fn) { @@ -208,7 +196,7 @@ pcmdOptions.forEach(function(pair) { this._pcmd[pair[0]] = speed; delete this._pcmd[pair[1]]; - return this; + return speed; }; Client.prototype[pair[1]] = function(speed) { @@ -217,6 +205,6 @@ pcmdOptions.forEach(function(pair) { this._pcmd[pair[1]] = speed; delete this._pcmd[pair[0]]; - return this; + return speed; }; });