diff --git a/package.json b/package.json index c894e6b..c029ea8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-poweredup", - "version": "1.1.1", + "version": "1.1.2", "description": "A Node.js module to interface with LEGO Powered UP components.", "homepage": "https://github.com/nathankellenicki/node-poweredup/", "main": "dist/poweredup.js", diff --git a/wedo2smarthub.ts b/wedo2smarthub.ts index 4728a9a..b50a38d 100644 --- a/wedo2smarthub.ts +++ b/wedo2smarthub.ts @@ -47,6 +47,9 @@ export class WeDo2SmartHub extends Hub { this._subscribeToCharacteristic(this._characteristics[Consts.BLECharacteristics.WEDO2_BUTTON], this._parseSensorMessage.bind(this)); this._subscribeToCharacteristic(this._characteristics[Consts.BLECharacteristics.WEDO2_BATTERY], this._parseBatteryMessage.bind(this)); this._subscribeToCharacteristic(this._characteristics[Consts.BLECharacteristics.WEDO2_HIGH_CURRENT_ALERT], this._parseHighCurrentAlert.bind(this)); + this._characteristics[Consts.BLECharacteristics.WEDO2_BATTERY].read((err, data) => { + this._parseBatteryMessage(data); + }); debug("Connect completed"); return resolve(); });