devicestack
Advanced tools
Comparing version 1.3.2 to 1.3.3
@@ -75,2 +75,4 @@ var util = require('util'), | ||
var connecting = false; | ||
this.deviceLoader.on('plug', function(device) { | ||
@@ -84,3 +86,8 @@ self.currentState.plugged.push(device); | ||
if (self.currentState.connectionMode === 'autoconnect' || self.currentState.connectionMode === 'autoconnectOne' && self.currentState.connected.length === 0) { | ||
self.connectDevice(device); | ||
if (!connecting) { | ||
self.connectDevice(device, function() { | ||
connecting = false; | ||
}); | ||
connecting = true; | ||
} | ||
} | ||
@@ -170,3 +177,3 @@ } | ||
var self = this; | ||
if (this.currentState.plugged.length > 0) { | ||
@@ -173,0 +180,0 @@ callback(null, this.currentState); |
@@ -97,3 +97,3 @@ var EventEmitter2 = require('eventemitter2').EventEmitter2, | ||
// if (!self.isRunning) return; | ||
// process.nextTick(function() { | ||
@@ -100,0 +100,0 @@ // self.trigger(function() { |
@@ -33,3 +33,10 @@ var sp = require("serialport"), | ||
var devices = _.map(resPorts, function(p) { | ||
return new self.Device(p.comName); | ||
var found = _.find(self.oldDevices, function(dev) { | ||
return dev.get('portName') === p.comName; | ||
}); | ||
if (found) { | ||
return found; | ||
} else { | ||
return new self.Device(p.comName); | ||
} | ||
}) || []; | ||
@@ -36,0 +43,0 @@ |
{ | ||
"name": "devicestack", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "This module helps you to represent a device and its protocol.", | ||
@@ -8,3 +8,3 @@ "private": false, | ||
"engines": { | ||
"node": ">=0.8.0", | ||
"node": ">=0.8.x", | ||
"npm": ">=1.1.x" | ||
@@ -24,3 +24,3 @@ }, | ||
"optionalDependencies": { | ||
"serialport": "https://github.com/KABA-CCEAC/node-serialport.git/node-serialport/tarball/master" | ||
"serialport": "https://github.com/KABA-CCEAC/node-serialport/tarball/master" | ||
}, | ||
@@ -27,0 +27,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93825
2020