More debug, ports property
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-12-13 22:41:03 +09:00
parent 59179652dd
commit 77d99f6b39
4 changed files with 12 additions and 2 deletions

2
package-lock.json generated
View File

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

View File

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

View File

@ -132,6 +132,15 @@ export class Hub extends EventEmitter {
} }
/**
* @readonly
* @property {string[]} current Current usage of the hub (Milliamps)
*/
public get ports () {
return Object.keys(this._ports);
}
/** /**
* Connect to the Hub. * Connect to the Hub.
* @method Hub#connect * @method Hub#connect

View File

@ -103,6 +103,7 @@ export class WebBLEDevice extends EventEmitter implements IBLEDevice {
for (let i = 0; i < buf.length; i++) { for (let i = 0; i < buf.length; i++) {
buf[i] = view[i]; buf[i] = view[i];
} }
debug("Incoming data", buf);
return callback(buf); return callback(buf);
}; };
this._characteristics[uuid].addEventListener("characteristicvaluechanged", this._listeners[uuid]); this._characteristics[uuid].addEventListener("characteristicvaluechanged", this._listeners[uuid]);