Fix setLEDColor regression
This commit is contained in:
parent
3bbca30296
commit
1e40bdd537
@ -91,12 +91,12 @@ export class LPF2Hub extends Hub {
|
||||
*/
|
||||
public setLEDColor (color: number | boolean) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let data = Buffer.from([0x41, 0x32, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00]);
|
||||
let data = Buffer.from([0x41, this._ledPort, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00]);
|
||||
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, data);
|
||||
if (typeof color === "boolean") {
|
||||
color = 0;
|
||||
}
|
||||
data = Buffer.from([0x81, 0x32, 0x11, 0x51, 0x00, color]);
|
||||
data = Buffer.from([0x81, this._ledPort, 0x11, 0x51, 0x00, color]);
|
||||
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, data);
|
||||
return resolve();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user