Skip to content

Commit

Permalink
2.3.5
Browse files Browse the repository at this point in the history
* (Apollon77) serial device discovery fixed
  • Loading branch information
Apollon77 committed May 2, 2020
1 parent baf655a commit 366dae1
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ Just now it can detect via ping, UPnP (serial planned).

## Changelog

### 2.3.5 (2020-05-01)
* (Apollon77) serial device discovery fixed

### 2.3.4 (2020-04-30)
* (Apollon77) make sure to check if initialization was done when ending (Sentry IOBROKER-DISCOVERY-8)
* (APollon77) fix megad discovery error
Expand Down
14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "discovery",
"version": "2.3.4",
"version": "2.3.5",
"news": {
"2.3.5": {
"en": "serial device discovery fixed",
"de": "Erkennung serieller Geräte behoben",
"ru": "исправлено обнаружение серийного устройства",
"pt": "descoberta de dispositivo serial corrigida",
"nl": "seriële apparaatdetectie opgelost",
"fr": "détection de périphérique série corrigée",
"it": "rilevamento dispositivo seriale fisso",
"es": "descubrimiento de dispositivo en serie arreglado",
"pl": "naprawiono wykrywanie urządzeń szeregowych",
"zh-cn": "修复了串行设备发现"
},
"2.3.4": {
"en": "potential crash case fixed",
"de": "Möglicher Crash-Fall behoben",
Expand Down
10 changes: 6 additions & 4 deletions lib/methods/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ function listPorts(self) {
let wait = false;
if (SerialPort) {
wait = true;
SerialPort.list((err, ports) => {
SerialPort.list().then(ports => {
ports.forEach(port => {
let found = false;
for (let f = 0; f < list.length; f++) {
if (list[f]._addr === port.comName) {
if (list[f]._addr === port.path) {
found = true;
break;
}
}
if (!found) {
const device = {
_addr: port.comName,
_addr: port.path,
_name: port.manufacturer,
_data: port
};
Expand All @@ -36,6 +36,8 @@ function listPorts(self) {
}
});
self.done();
}). catch(e => {
self.adapter.log.warn('Some error by listing of serial ports: ' + e);
});
} else if (fs.existsSync('/dev/')) {
try {
Expand All @@ -60,7 +62,7 @@ function listPorts(self) {
}
}
} catch (e) {
self.adapter.log.warn('Some error by list of /dev/: ' + e);
self.adapter.log.warn('Some error by listing of /dev/: ' + e);
}
}

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iobroker.discovery",
"description": "This adapter tries to detect devices in local network.",
"version": "2.3.4",
"version": "2.3.5",
"author": "bluefox <[email protected]>",
"contributors": [
"bluefox <[email protected]>",
Expand Down

0 comments on commit 366dae1

Please sign in to comment.