From 1e40bdd53710fb7914c46bc5bf9efeb03ead0387 Mon Sep 17 00:00:00 2001 From: Michal Szafranski Date: Sun, 3 Nov 2019 14:24:37 +0100 Subject: [PATCH] Fix setLEDColor regression --- src/lpf2hub.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lpf2hub.ts b/src/lpf2hub.ts index 3a56712..a6fe694 100644 --- a/src/lpf2hub.ts +++ b/src/lpf2hub.ts @@ -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(); });