Skip to content

Commit 47a2951

Browse files
Support for the discover method with id on macOS (#47)
Co-authored-by: zizi4n5 <[email protected]>
1 parent e7c98aa commit 47a2951

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/switchbot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ class Switchbot {
217217
}
218218
if (id) {
219219
id = id.toLowerCase().replace(/\:/g, '');
220-
if (ad.id !== id) {
220+
ad_id = ad.address.toLowerCase().replace(/[^a-z0-9]/g, '');
221+
if (ad_id !== id) {
221222
return false;
222223
}
223224
}

0 commit comments

Comments
 (0)