node-switchbot 1.6.0-beta.5 → 1.6.0-beta.7
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 +15 -6
- package/package.json +1 -1
|
@@ -377,15 +377,21 @@ class SwitchbotAdvertising {
|
|
|
377
377
|
}
|
|
378
378
|
return null;
|
|
379
379
|
}
|
|
380
|
-
|
|
381
|
-
let
|
|
380
|
+
let byte1 = buf.readUInt8(1);//power and light status
|
|
381
|
+
let byte2 = buf.readUInt8(2);//bulb brightness
|
|
382
|
+
let byte3 = buf.readUInt8(3);//bulb R
|
|
383
|
+
let byte4 = buf.readUInt8(4);//bulb G
|
|
384
|
+
let byte5 = buf.readUInt8(5);//bulb B
|
|
385
|
+
let byte6 = buf.readUInt8(6);//bulb temperature
|
|
382
386
|
let byte7 = buf.readUInt8(7);
|
|
383
387
|
let byte8 = buf.readUInt8(8);
|
|
384
388
|
let byte9 = buf.readUInt8(9);
|
|
385
|
-
let byte10 = buf.readUInt8(10)
|
|
386
|
-
|
|
389
|
+
let byte10 = buf.readUInt8(10);//bulb mode
|
|
387
390
|
|
|
388
|
-
let
|
|
391
|
+
let red = byte3;
|
|
392
|
+
let green = byte4;
|
|
393
|
+
let blue = byte5;
|
|
394
|
+
let color_Temperature = byte6;
|
|
389
395
|
let state = byte7 & 0b01111111 ? true : false;
|
|
390
396
|
let brightness = byte7 & 0b01111111;
|
|
391
397
|
let delay = byte8 & 0b10000000;
|
|
@@ -397,8 +403,11 @@ class SwitchbotAdvertising {
|
|
|
397
403
|
let data = {
|
|
398
404
|
model: "u",
|
|
399
405
|
modelName: "WoBulb",
|
|
400
|
-
|
|
406
|
+
color_Temperature: color_Temperature,
|
|
401
407
|
state: state,
|
|
408
|
+
red: red,
|
|
409
|
+
green: green,
|
|
410
|
+
blue: blue,
|
|
402
411
|
brightness: brightness,
|
|
403
412
|
delay: delay,
|
|
404
413
|
preset: preset,
|
package/package.json
CHANGED