added sorted list of devices discovered
This commit is contained in:
parent
eead389056
commit
b039baea5b
7 changed files with 15 additions and 71 deletions
|
|
@ -198,7 +198,8 @@ class PlejdService extends EventEmitter {
|
|||
}
|
||||
|
||||
if (!uuid) {
|
||||
this.device = Object.values(this.devices)[this.deviceIdx];
|
||||
this.sortedDevices = Object.values(this.devices).sort((a, b) => b.rssi - a.rssi);
|
||||
this.device = sortedDevices[this.deviceIdx];
|
||||
}
|
||||
else {
|
||||
this.device = this.devices[uuid];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue