Skip to content

Commit

Permalink
fix: skip invalid device id
Browse files Browse the repository at this point in the history
  • Loading branch information
Jin committed Dec 17, 2023
1 parent b53198d commit f031173
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/ThinQ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export class ThinQ {
return [];
});

return listDevices.map(dev => new Device(dev));
return listDevices.map(device => new Device(device))
// skip all device invalid id
.filter(device => device.id.match(/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/));
}

public async setup(device: Device) {
Expand Down

0 comments on commit f031173

Please sign in to comment.