Lights working on wedo2, added docs, bumped version

This commit is contained in:
Nathan Kunicki 2018-08-16 15:08:46 +01:00
parent 7a3878ff7a
commit 3cc7df6b74
4 changed files with 6 additions and 6 deletions

View File

@ -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 | <a href="https://brickset.com/sets/17101-1/">17101</a> |
| Boost Tacho Motor | Motor/Sensor | *Partial* | Yes | *Partial* | <a href="https://brickset.com/sets/17101-1/">17101</a> |
| Powered Up Train Motor | Motor | Yes | Yes | Yes | <a href="https://brickset.com/sets/60197-1/">60197</a><br /><a href="https://brickset.com/sets/60198-1/">60198</a> |
| Powered Up LED Lights | Light | Unknown | Unknown | Unknown | <a href="https://brickset.com/sets/88005-1/">88005</a> |
| Powered Up LED Lights | Light | Yes | Yes | Yes | <a href="https://brickset.com/sets/88005-1/">88005</a> |
### Known Issues and Limitations

View File

@ -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 | <a href="https://brickset.com/sets/17101-1/">17101</a> |
| Boost Tacho Motor | Motor/Sensor | *Partial* | Yes | *Partial* | <a href="https://brickset.com/sets/17101-1/">17101</a> |
| Powered Up Train Motor | Motor | Yes | Yes | Yes | <a href="https://brickset.com/sets/60197-1/">60197</a><br /><a href="https://brickset.com/sets/60198-1/">60198</a> |
| Powered Up LED Lights | Light | Unknown | Unknown | Unknown | <a href="https://brickset.com/sets/88005-1/">88005</a> |
| Powered Up LED Lights | Light | Yes | Yes | Yes | <a href="https://brickset.com/sets/88005-1/">88005</a> |
### Known Issues and Limitations

View File

@ -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",

View File

@ -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 {