node-switchbot 1.8.1-beta.2 → 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 +6 -10
- package/package.json +1 -1
package/lib/switchbot.js
CHANGED
|
@@ -207,14 +207,12 @@ class Switchbot {
|
|
|
207
207
|
return;
|
|
208
208
|
default: // 'resetting', 'unknown'
|
|
209
209
|
this.noble.once("stateChange", (state) => {
|
|
210
|
-
require("events").EventEmitter.prototype._maxListeners =
|
|
211
|
-
require("events").defaultMaxListeners =
|
|
210
|
+
require("events").EventEmitter.prototype._maxListeners = 1000;
|
|
211
|
+
require("events").defaultMaxListeners = 1000;
|
|
212
212
|
|
|
213
213
|
process.on("warning", function (err) {
|
|
214
214
|
if ("MaxListenersExceededWarning" == err.name) {
|
|
215
|
-
console.log("
|
|
216
|
-
// write to log function
|
|
217
|
-
process.exit(1); // its up to you what then in my case script was hang
|
|
215
|
+
console.log("MaxListenersExceededWarning");
|
|
218
216
|
}
|
|
219
217
|
});
|
|
220
218
|
if (state === "poweredOn") {
|
|
@@ -385,14 +383,12 @@ class Switchbot {
|
|
|
385
383
|
},
|
|
386
384
|
false
|
|
387
385
|
);
|
|
388
|
-
require("events").EventEmitter.prototype._maxListeners =
|
|
389
|
-
require("events").defaultMaxListeners =
|
|
386
|
+
require("events").EventEmitter.prototype._maxListeners = 1000;
|
|
387
|
+
require("events").defaultMaxListeners = 1000;
|
|
390
388
|
|
|
391
389
|
process.on("warning", function (err) {
|
|
392
390
|
if ("MaxListenersExceededWarning" == err.name) {
|
|
393
|
-
console.log("
|
|
394
|
-
// write to log function
|
|
395
|
-
process.exit(1); // its up to you what then in my case script was hang
|
|
391
|
+
console.log("MaxListenersExceededWarning");
|
|
396
392
|
}
|
|
397
393
|
});
|
|
398
394
|
if (!valid) {
|
package/package.json
CHANGED