node-switchbot 1.8.1-beta.0 → 1.8.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/switchbot.js +20 -1
- package/package.json +1 -1
package/lib/switchbot.js
CHANGED
|
@@ -31,7 +31,7 @@ class Switchbot {
|
|
|
31
31
|
if (params && params.noble) {
|
|
32
32
|
noble = params.noble;
|
|
33
33
|
} else {
|
|
34
|
-
noble = require("@
|
|
34
|
+
noble = require("@switchbot/noble");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
// Public properties
|
|
@@ -207,6 +207,16 @@ class Switchbot {
|
|
|
207
207
|
return;
|
|
208
208
|
default: // 'resetting', 'unknown'
|
|
209
209
|
this.noble.once("stateChange", (state) => {
|
|
210
|
+
require("events").EventEmitter.prototype._maxListeners = 70;
|
|
211
|
+
require("events").defaultMaxListeners = 70;
|
|
212
|
+
|
|
213
|
+
process.on("warning", function (err) {
|
|
214
|
+
if ("MaxListenersExceededWarning" == err.name) {
|
|
215
|
+
console.log("o kurwa");
|
|
216
|
+
// write to log function
|
|
217
|
+
process.exit(1); // its up to you what then in my case script was hang
|
|
218
|
+
}
|
|
219
|
+
});
|
|
210
220
|
if (state === "poweredOn") {
|
|
211
221
|
resolve();
|
|
212
222
|
} else {
|
|
@@ -375,7 +385,16 @@ class Switchbot {
|
|
|
375
385
|
},
|
|
376
386
|
false
|
|
377
387
|
);
|
|
388
|
+
require("events").EventEmitter.prototype._maxListeners = 70;
|
|
389
|
+
require("events").defaultMaxListeners = 70;
|
|
378
390
|
|
|
391
|
+
process.on("warning", function (err) {
|
|
392
|
+
if ("MaxListenersExceededWarning" == err.name) {
|
|
393
|
+
console.log("o kurwa");
|
|
394
|
+
// write to log function
|
|
395
|
+
process.exit(1); // its up to you what then in my case script was hang
|
|
396
|
+
}
|
|
397
|
+
});
|
|
379
398
|
if (!valid) {
|
|
380
399
|
reject(new Error(parameterChecker.error.message));
|
|
381
400
|
return;
|
package/package.json
CHANGED