node-switchbot 1.6.0-beta.5 → 1.6.0-beta.6
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 +13 -4
- package/package.json +1 -1
|
@@ -377,14 +377,20 @@ 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
|
|
|
391
|
+
let r = byte3;
|
|
392
|
+
let g = byte4;
|
|
393
|
+
let b = byte5;
|
|
388
394
|
let sequence_number = byte6;
|
|
389
395
|
let state = byte7 & 0b01111111 ? true : false;
|
|
390
396
|
let brightness = byte7 & 0b01111111;
|
|
@@ -399,6 +405,9 @@ class SwitchbotAdvertising {
|
|
|
399
405
|
modelName: "WoBulb",
|
|
400
406
|
sequence_number: sequence_number,
|
|
401
407
|
state: state,
|
|
408
|
+
r: r,
|
|
409
|
+
g: g,
|
|
410
|
+
b: b,
|
|
402
411
|
brightness: brightness,
|
|
403
412
|
delay: delay,
|
|
404
413
|
preset: preset,
|
package/package.json
CHANGED