Can not retrieve human readable device type from devices. Updated web bluetooth example

This commit is contained in:
Nathan Kellenicki 2020-01-13 12:17:51 -08:00
parent 5fde49c0c2
commit ea20b1bee0
2 changed files with 7 additions and 0 deletions

View File

@ -81,6 +81,10 @@ export class Device extends EventEmitter {
return this._type; return this._type;
} }
public get typeName () {
return Consts.DeviceTypeNames[this.type];
}
public get mode () { public get mode () {
return this._mode; return this._mode;
} }

View File

@ -139,6 +139,8 @@ export class LPF2Hub extends BaseHub {
const callback = this._propertyRequestCallbacks[property]; const callback = this._propertyRequestCallbacks[property];
if (callback) { if (callback) {
callback(message); callback(message);
} else {
this._parseHubPropertyResponse(message);
} }
delete this._propertyRequestCallbacks[property]; delete this._propertyRequestCallbacks[property];
break; break;
@ -193,6 +195,7 @@ export class LPF2Hub extends BaseHub {
// Button press reports // Button press reports
if (message[3] === 0x02) { if (message[3] === 0x02) {
console.log("BUTTON PRESS", message);
if (message[5] === 1) { if (message[5] === 1) {
/** /**
* Emits when a button is pressed. * Emits when a button is pressed.