From ea20b1bee04a150aa44b62e76fa7bb4d21927898 Mon Sep 17 00:00:00 2001 From: Nathan Kellenicki Date: Mon, 13 Jan 2020 12:17:51 -0800 Subject: [PATCH] Can not retrieve human readable device type from devices. Updated web bluetooth example --- src/devices/device.ts | 4 ++++ src/hubs/lpf2hub.ts | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/devices/device.ts b/src/devices/device.ts index 36d659c..245c5d6 100644 --- a/src/devices/device.ts +++ b/src/devices/device.ts @@ -81,6 +81,10 @@ export class Device extends EventEmitter { return this._type; } + public get typeName () { + return Consts.DeviceTypeNames[this.type]; + } + public get mode () { return this._mode; } diff --git a/src/hubs/lpf2hub.ts b/src/hubs/lpf2hub.ts index 2f503df..8d980f5 100644 --- a/src/hubs/lpf2hub.ts +++ b/src/hubs/lpf2hub.ts @@ -139,6 +139,8 @@ export class LPF2Hub extends BaseHub { const callback = this._propertyRequestCallbacks[property]; if (callback) { callback(message); + } else { + this._parseHubPropertyResponse(message); } delete this._propertyRequestCallbacks[property]; break; @@ -193,6 +195,7 @@ export class LPF2Hub extends BaseHub { // Button press reports if (message[3] === 0x02) { + console.log("BUTTON PRESS", message); if (message[5] === 1) { /** * Emits when a button is pressed.