node-switchbot 1.8.1-beta.1 → 1.8.1-beta.3
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 +15 -0
- package/package.json +1 -1
package/lib/switchbot.js
CHANGED
|
@@ -207,6 +207,14 @@ class Switchbot {
|
|
|
207
207
|
return;
|
|
208
208
|
default: // 'resetting', 'unknown'
|
|
209
209
|
this.noble.once("stateChange", (state) => {
|
|
210
|
+
require("events").EventEmitter.prototype._maxListeners = 1000;
|
|
211
|
+
require("events").defaultMaxListeners = 1000;
|
|
212
|
+
|
|
213
|
+
process.on("warning", function (err) {
|
|
214
|
+
if ("MaxListenersExceededWarning" == err.name) {
|
|
215
|
+
console.log("MaxListenersExceededWarning");
|
|
216
|
+
}
|
|
217
|
+
});
|
|
210
218
|
if (state === "poweredOn") {
|
|
211
219
|
resolve();
|
|
212
220
|
} else {
|
|
@@ -375,7 +383,14 @@ class Switchbot {
|
|
|
375
383
|
},
|
|
376
384
|
false
|
|
377
385
|
);
|
|
386
|
+
require("events").EventEmitter.prototype._maxListeners = 1000;
|
|
387
|
+
require("events").defaultMaxListeners = 1000;
|
|
378
388
|
|
|
389
|
+
process.on("warning", function (err) {
|
|
390
|
+
if ("MaxListenersExceededWarning" == err.name) {
|
|
391
|
+
console.log("MaxListenersExceededWarning");
|
|
392
|
+
}
|
|
393
|
+
});
|
|
379
394
|
if (!valid) {
|
|
380
395
|
reject(new Error(parameterChecker.error.message));
|
|
381
396
|
return;
|
package/package.json
CHANGED