From 16d31559b42f4c64af1ac7332ee5cb92e6dde912 Mon Sep 17 00:00:00 2001 From: zizi4n5 Date: Sat, 16 May 2020 10:24:20 +0900 Subject: [PATCH] Support for the discover method with id on macOS --- lib/switchbot.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/switchbot.js b/lib/switchbot.js index b2005479..d4355f70 100644 --- a/lib/switchbot.js +++ b/lib/switchbot.js @@ -201,7 +201,8 @@ class Switchbot { } if (id) { id = id.toLowerCase().replace(/\:/g, ''); - if (ad.id !== id) { + ad_id = ad.address.toLowerCase().replace(/[^a-z0-9]/g, ''); + if (ad_id !== id) { return false; } }