diff --git a/dist/device.js b/dist/device.js index 072c8a1..09f7254 100644 --- a/dist/device.js +++ b/dist/device.js @@ -28,13 +28,19 @@ this.self = this; this.robot = opts.robot; this.name = opts.name; + this.pin = opts.pin; this.connection = this.determineConnection(opts.connection) || this.defaultConnection(); this.driver = this.requireDriver(opts.driver); this.addCommands(this.driver); } Device.prototype.start = function() { - Logger.info("Starting driver " + this.driver.name); + var msg; + msg = "Starting device '" + this.name + "'"; + if (this.pin != null) { + msg += " on pin " + this.pin; + } + Logger.info(msg); return this.driver.start(); }; diff --git a/src/device.coffee b/src/device.coffee index f4492ca..b378b96 100644 --- a/src/device.coffee +++ b/src/device.coffee @@ -16,12 +16,15 @@ module.exports = class Device extends EventEmitter @self = this @robot = opts.robot @name = opts.name + @pin = opts.pin @connection = @determineConnection(opts.connection) or @defaultConnection() @driver = @requireDriver(opts.driver) @addCommands(@driver) start: -> - Logger.info "Starting driver #{ @driver.name }" + msg = "Starting device '#{ @name }'" + msg += " on pin #{@pin}" if @pin? + Logger.info msg @driver.start() determineConnection: (c) ->