Proper initialization of adaptors
This commit is contained in:
parent
541d70b66d
commit
bf4d42970e
|
@ -29,5 +29,5 @@ module.exports = class Connection
|
|||
@adaptor.disconnect
|
||||
|
||||
requireAdaptor: (adaptorName) ->
|
||||
console.log "dynamic load adaptor"
|
||||
Logger.info "dynamic load adaptor"
|
||||
@robot.requireAdaptor(adaptorName, self)
|
||||
|
|
|
@ -20,6 +20,7 @@ class Loopback
|
|||
|
||||
connect: ->
|
||||
console.log "Connecting to adaptor '#{@name}'..."
|
||||
self
|
||||
|
||||
disconnect: ->
|
||||
console.log "Disconnecting from adaptor '#{@name}'..."
|
||||
|
|
|
@ -72,6 +72,9 @@ module.exports = class Robot
|
|||
require("cylon-#{adaptorName}").register(self) unless self.adaptors[adaptorName]?
|
||||
require(self.adaptors[adaptorName]).adaptor(name: adaptorName).connect(connection: connection)
|
||||
|
||||
requireAdaptor: (adaptorName, connection) ->
|
||||
self.requireAdaptor(adaptorName, connection)
|
||||
|
||||
registerAdaptor: (moduleName, adaptorName) ->
|
||||
return if self.adaptors[adaptorName]?
|
||||
self.adaptors[adaptorName] = moduleName
|
||||
|
|
Loading…
Reference in New Issue