Disconnect fix
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 2022-01-18 21:17:22 -08:00
parent f71411aacd
commit ce0f4509be
4 changed files with 6 additions and 3 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "node-poweredup",
"version": "8.0.1",
"version": "8.0.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "node-poweredup",
"version": "8.0.1",
"version": "8.0.2",
"license": "MIT",
"dependencies": {
"@abandonware/noble": "1.9.2-15",

View File

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

View File

@ -79,6 +79,8 @@ export class NobleDevice extends EventEmitter implements IBLEAbstraction {
public disconnect () {
return new Promise<void>((resolve) => {
this._noblePeripheral.disconnect();
this._connecting = false;
this._connected = false;
return resolve();
});
}

View File

@ -68,6 +68,7 @@ export class WebBLEDevice extends EventEmitter implements IBLEAbstraction {
public disconnect () {
return new Promise<void>((resolve) => {
this._webBLEServer.device.gatt.disconnect();
this._connected = false;
return resolve();
});
}