Adding callback back to battery read to fix clearing the characteristicChanged callback by accident.

This commit is contained in:
Evelyn Eastmond 2018-12-12 21:04:30 -05:00
parent d7b6cfae97
commit e4b82aeaef
2 changed files with 4 additions and 2 deletions
src
extensions/scratch3_wedo2
io

View file

@ -787,7 +787,9 @@ class WeDo2 {
_checkBatteryLevel () {
this._ble.read(
BLEService.DEVICE_SERVICE,
BLECharacteristic.LOW_VOLTAGE_ALERT
BLECharacteristic.LOW_VOLTAGE_ALERT,
false,
this._onMessage
);
}

View file

@ -80,7 +80,7 @@ class BLE extends JSONRPCWebSocket {
if (this._discoverTimeoutID) {
window.clearTimeout(this._discoverTimeoutID);
}
this._runtime.emit(this._runtime.constructor.PERIPHERAL_DISCONNECT);
}