Fix for scanStop on Raspberry Pis
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 2020-06-12 13:48:20 -07:00
parent 9b4d496f34
commit 6bdd454772
3 changed files with 7 additions and 2 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "6.6.1",
"version": "6.7.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "node-poweredup",
"version": "6.6.1",
"version": "6.7.0",
"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

@ -33,6 +33,11 @@ noble.on("stateChange", (state: string) => {
debug("Scanning started");
startScanning();
}
noble.on('scanStop', () => {
setTimeout(() => {
startScanning();
}, 1000);
});
} else {
noble.stopScanning();
}