Skip to content

Commit

Permalink
Return fetched info when ready is called
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinBol committed Oct 7, 2015
1 parent 7a7cbac commit e8e9ea7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/neo.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ function Neo ( host, port ) {
if ( !host ) {
scanNetwork( this.port, function ( port, host ) {
self.host = host;
self.emit('ready', host, port);
events.EventEmitter.call( self );
self.info( function( data ) {
self.emit( 'ready', host, port, data.devices);
events.EventEmitter.call( self );
});
} );
}
else {
Expand Down Expand Up @@ -73,8 +75,8 @@ var createConnection = function ( port, host, callback ) {

// When a socket is closed
socket.on( 'close', function () {
if(!returned){
callback( error, host);
if ( !returned ) {
callback( error, host );
}
} );

Expand Down

0 comments on commit e8e9ea7

Please sign in to comment.