diff --git a/README.md b/README.md index 54382d80..406ef742 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ si.cpu() (last 7 major and minor version releases) +- Version 5.23.0: `usb()` added serial number (linux) - Version 5.22.0: `wifiConnections()` added signal quality - Version 5.21.0: `graphics()` added subVendor (linux) - Version 5.20.0: `mem()` added writeback and dirty (linux) diff --git a/lib/usb.js b/lib/usb.js index 8e9d354b..0a6edba9 100644 --- a/lib/usb.js +++ b/lib/usb.js @@ -114,7 +114,6 @@ function getDarwinUsbType(name) { return result; } - function parseDarwinUsb(usb, id) { const result = {}; result.id = id; @@ -258,7 +257,7 @@ function usb(callback) { const parts = stdout.toString().split(/\n\s*\n/); for (let i = 0; i < parts.length; i++) { const usb = parseWindowsUsb(parts[i].split('\n'), i); - if (usb) { + if (usb && result.filter(x => x.deviceId === usb.deviceId).length === 0) { result.push(usb); } }