node-switchbot 1.6.0-beta.0 → 1.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/switchbot-advertising.js +25 -30
- package/package.json +2 -2
|
@@ -360,40 +360,35 @@ class SwitchbotAdvertising {
|
|
|
360
360
|
}
|
|
361
361
|
return null;
|
|
362
362
|
}
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
363
|
+
|
|
364
|
+
const byte6 = buf.readUInt8(6);
|
|
365
|
+
const byte7 = buf.readUInt8(7);
|
|
366
|
+
const byte8 = buf.readUInt8(8);
|
|
367
|
+
const byte9 = buf.readUInt8(9);
|
|
368
|
+
const byte10 = buf.readUInt8(10);
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
const sequence_number = byte6;
|
|
372
|
+
const isOn = byte7 & 0b01111111 ? true : false;
|
|
373
|
+
const brightness = byte7 & 0b01111111;
|
|
374
|
+
const delay = byte8 & 0b10000000;
|
|
375
|
+
const preset = byte8 & 0b00001000;
|
|
376
|
+
const color_mode = byte8 & 0b00000111;
|
|
377
|
+
const speed = byte9 & 0b01111111;
|
|
378
|
+
const loop_index = byte10 & 0b11111110;
|
|
378
379
|
|
|
379
380
|
const data = {
|
|
380
381
|
model: "u",
|
|
381
382
|
modelName: "WoBulb",
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
model: "u",
|
|
386
|
-
modelName: "WoBulb",
|
|
387
|
-
state: state,
|
|
388
|
-
lightLevel: lightLevel,
|
|
383
|
+
sequence_number: sequence_number,
|
|
384
|
+
isOn: isOn,
|
|
385
|
+
brightness: brightness,
|
|
389
386
|
delay: delay,
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
loopIndex: loopIndex,
|
|
396
|
-
};*/
|
|
387
|
+
preset: preset,
|
|
388
|
+
color_mode: color_mode,
|
|
389
|
+
speed: speed,
|
|
390
|
+
loop_index: loop_index,
|
|
391
|
+
};
|
|
397
392
|
|
|
398
393
|
return data;
|
|
399
394
|
}
|
|
@@ -555,7 +550,7 @@ class SwitchbotAdvertising {
|
|
|
555
550
|
const byte9 = buf.readUInt8(9);
|
|
556
551
|
const byte10 = buf.readUInt8(10);
|
|
557
552
|
|
|
558
|
-
const isOn = byte7 & 0b10000000;
|
|
553
|
+
const isOn = byte7 & 0b10000000 ? true : false;
|
|
559
554
|
const brightness = byte7 & 0b01111111;
|
|
560
555
|
const delay = byte8 & 0b10000000;
|
|
561
556
|
const preset = byte8 & 0b00001000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-switchbot",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.1",
|
|
4
4
|
"description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).",
|
|
5
5
|
"main": "./lib/switchbot.js",
|
|
6
6
|
"files": [
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"@abandonware/noble": "^1.9.2-15"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"npm-check-updates": "^16.3.
|
|
40
|
+
"npm-check-updates": "^16.3.13"
|
|
41
41
|
}
|
|
42
42
|
}
|