Fix setLEDColor regression

This commit is contained in:
Michal Szafranski 2019-11-03 14:24:37 +01:00
parent 3bbca30296
commit 1e40bdd537

View File

@ -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();
});