From 3cc7df6b749795c2852140d22b2e2ec4d1df8c9a Mon Sep 17 00:00:00 2001 From: Nathan Kunicki Date: Thu, 16 Aug 2018 15:08:46 +0100 Subject: [PATCH] Lights working on wedo2, added docs, bumped version --- ABOUT.md | 2 +- README.md | 2 +- package.json | 2 +- wedo2smarthub.ts | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ABOUT.md b/ABOUT.md index 2d88005..171e2a4 100644 --- a/ABOUT.md +++ b/ABOUT.md @@ -36,7 +36,7 @@ While most Powered UP components and Hubs are compatible with each other, there | Boost Color and Distance Sensor | Sensor | *Partial* | Yes | Yes | 17101 | | Boost Tacho Motor | Motor/Sensor | *Partial* | Yes | *Partial* | 17101 | | Powered Up Train Motor | Motor | Yes | Yes | Yes | 60197
60198 | -| Powered Up LED Lights | Light | Unknown | Unknown | Unknown | 88005 | +| Powered Up LED Lights | Light | Yes | Yes | Yes | 88005 | ### Known Issues and Limitations diff --git a/README.md b/README.md index 3bd653e..b93981a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ While most Powered UP components and Hubs are compatible with each other, there | Boost Color and Distance Sensor | Sensor | *Partial* | Yes | Yes | 17101 | | Boost Tacho Motor | Motor/Sensor | *Partial* | Yes | *Partial* | 17101 | | Powered Up Train Motor | Motor | Yes | Yes | Yes | 60197
60198 | -| Powered Up LED Lights | Light | Unknown | Unknown | Unknown | 88005 | +| Powered Up LED Lights | Light | Yes | Yes | Yes | 88005 | ### Known Issues and Limitations diff --git a/package.json b/package.json index f1f03f4..e8defc6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-poweredup", - "version": "1.0.12", + "version": "1.1.0", "description": "A Node.js module to interface with LEGO Powered UP components.", "homepage": "https://github.com/nathankellenicki/node-poweredup/", "main": "dist/poweredup.js", diff --git a/wedo2smarthub.ts b/wedo2smarthub.ts index 168e2b3..4728a9a 100644 --- a/wedo2smarthub.ts +++ b/wedo2smarthub.ts @@ -185,12 +185,12 @@ export class WeDo2SmartHub extends Hub { public setLightBrightness (port: string, brightness: number, time?: number) { const portObj = this._portLookup(port); return new Promise((resolve, reject) => { - const data = Buffer.from([portObj.value, 0x01, 0x02, this._mapSpeed(brightness)]); - this._writeMessage(Consts.BLECharacteristics.LPF2_ALL, data); + const data = Buffer.from([portObj.value, 0x01, 0x02, brightness]); + this._writeMessage(Consts.BLECharacteristics.WEDO2_MOTOR_VALUE_WRITE, data); if (time) { setTimeout(() => { const data = Buffer.from([portObj.value, 0x01, 0x02, 0x00]); - this._writeMessage(Consts.BLECharacteristics.LPF2_ALL, data); + this._writeMessage(Consts.BLECharacteristics.WEDO2_MOTOR_VALUE_WRITE, data); return resolve(); }, time); } else {