You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let bot_list =awaitswitchbot.discover({ model:"H", quick:true });
223
223
if (bot_list.length===0) {
224
224
thrownewError("No device was found.");
225
225
}
@@ -246,13 +246,13 @@ In this code, you can get a [`SwitchbotDeviceWoHand`](#SwitchbotDeviceWoHand-obj
246
246
In order to use the node-switchbot, you have to load the node-switchbot module as follows:
247
247
248
248
```JavaScript
249
-
constSwitchbot=require('node-switchbot');
249
+
let Switchbot =require('node-switchbot');
250
250
```
251
251
252
252
You can get an `Switchbot` constructor from the code above. Then you have to create an `Switchbot` object from the `Switchbot` constructor as follows:
253
253
254
254
```javascript
255
-
constswitchbot=newSwitchbot();
255
+
let switchbot =newSwitchbot();
256
256
```
257
257
258
258
The `Switchbot` constructor takes an argument optionally. It must be a hash object containing the properties as follows:
@@ -267,11 +267,11 @@ The sample code below shows how to pass a `Nobel` object to the `Switchbot` cons
267
267
268
268
```JavaScript
269
269
// Create a Noble object
270
-
constnoble=require('@abandonware/noble');
270
+
let noble =require('@abandonware/noble');
271
271
272
272
// Create a Switchbot object
273
-
constSwitchbot=require('node-switchbot');
274
-
constswitchbot=newSwitchbot({'noble': noble});
273
+
let Switchbot =require('node-switchbot');
274
+
let switchbot =newSwitchbot({'noble': noble});
275
275
```
276
276
277
277
In the code snippet above, the variable `switchbot` is an `Switchbot` object. The `Switchbot` object has a lot of methods as described in sections below.
0 commit comments