Fixed bug with retrieving hardware versions
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Nathan Kellenicki 2019-11-11 17:03:54 -08:00
parent 7255c83ae9
commit 0fbd27d41f
3 changed files with 6 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "4.2.0",
"version": "4.2.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "4.2.0",
"version": "4.2.1",
"description": "A Javascript module to interface with LEGO Powered Up components.",
"homepage": "https://github.com/nathankellenicki/node-poweredup/",
"main": "dist/node/index-node.js",

View File

@ -43,10 +43,11 @@ export class LPF2Hub extends Hub {
if (this.type === Consts.HubType.DUPLO_TRAIN_HUB) {
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x41, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01]));
}
this.emit("connect");
resolve();
setTimeout(() => {
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x01, 0x03, 0x05])); // Request firmware version again
this._writeMessage(Consts.BLECharacteristic.LPF2_ALL, Buffer.from([0x01, 0x04, 0x05])); // Request firmware version again
this.emit("connect");
resolve();
}, 200);
});
}
@ -267,7 +268,7 @@ export class LPF2Hub extends Hub {
let port = this._getPortForPortNumber(data[3]);
if (data[4] === 0x01) {
if (data[4] === 0x01 && process.env["PORT_DEBUG_INFO"]) {
this._sendPortInformationRequest(data[3]);
}