From cf6d2c88bc0614353b810e557efa07978b1fe1fb Mon Sep 17 00:00:00 2001 From: Edgar O Silva Date: Tue, 29 Oct 2013 18:15:41 -0600 Subject: [PATCH] Removing DriverName param in favor of opts, which already contains it. --- dist/device.js | 8 ++++---- src/device.coffee | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/device.js b/dist/device.js index 926e74d..2634c6e 100644 --- a/dist/device.js +++ b/dist/device.js @@ -35,7 +35,7 @@ this.name = opts.name; this.pin = opts.pin; this.connection = this.determineConnection(opts.connection) || this.defaultConnection(); - this.driver = this.requireDriver(opts.driver, opts); + this.driver = this.requireDriver(opts); proxyFunctionsToObject(this.driver.commands(), this.driver, klass); } @@ -66,12 +66,12 @@ return first; }; - Device.prototype.requireDriver = function(driverName, opts) { + Device.prototype.requireDriver = function(opts) { if (opts == null) { opts = {}; } - Logger.debug("Loading driver '" + driverName + "'"); - return this.robot.requireDriver(driverName, this.self, opts); + Logger.debug("Loading driver '" + opts.driver + "'"); + return this.robot.requireDriver(opts.driver, this.self, opts); }; return Device; diff --git a/src/device.coffee b/src/device.coffee index 0d0563f..bd85074 100644 --- a/src/device.coffee +++ b/src/device.coffee @@ -20,7 +20,7 @@ module.exports = class Device extends EventEmitter @name = opts.name @pin = opts.pin @connection = @determineConnection(opts.connection) or @defaultConnection() - @driver = @requireDriver(opts.driver, opts) + @driver = @requireDriver(opts) proxyFunctionsToObject @driver.commands(), @driver, klass start: (callback) => @@ -38,6 +38,6 @@ module.exports = class Device extends EventEmitter first or= v first - requireDriver: (driverName, opts = {}) -> - Logger.debug "Loading driver '#{driverName}'" - @robot.requireDriver(driverName, @self, opts) + requireDriver: (opts = {}) -> + Logger.debug "Loading driver '#{ opts.driver }'" + @robot.requireDriver(opts.driver, @self, opts)