node-switchbot 1.8.1-beta.4 → 1.8.1-beta.6

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.
Files changed (2) hide show
  1. package/lib/switchbot.js +4 -19
  2. package/package.json +1 -1
package/lib/switchbot.js CHANGED
@@ -207,16 +207,8 @@ class Switchbot {
207
207
  return;
208
208
  default: // 'resetting', 'unknown'
209
209
  this.noble.once("stateChange", (state) => {
210
-
211
- process.setMaxListeners(0);
212
- //require("events").EventEmitter.prototype._maxListeners = 1000;
213
- //require("events").defaultMaxListeners = 1000;
214
-
215
- //process.on("warning", function (err) {
216
- // if ("MaxListenersExceededWarning" == err.name) {
217
- // console.log("MaxListenersExceededWarning");
218
- // }
219
- // });
210
+ require("events").EventEmitter.prototype.setMaxListeners(0);
211
+ require("events").setMaxListeners(0);
220
212
  if (state === "poweredOn") {
221
213
  resolve();
222
214
  } else {
@@ -385,15 +377,8 @@ class Switchbot {
385
377
  },
386
378
  false
387
379
  );
388
- process.setMaxListeners(0);
389
- //require("events").EventEmitter.prototype._maxListeners = 1000;
390
- //require("events").defaultMaxListeners = 1000;
391
-
392
- //process.on("warning", function (err) {
393
- // if ("MaxListenersExceededWarning" == err.name) {
394
- // console.log("MaxListenersExceededWarning");
395
- // }
396
- // });
380
+ require("events").EventEmitter.prototype.setMaxListeners(0);
381
+ require("events").setMaxListeners(0);
397
382
  if (!valid) {
398
383
  reject(new Error(parameterChecker.error.message));
399
384
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-switchbot",
3
- "version": "1.8.1-beta.4",
3
+ "version": "1.8.1-beta.6",
4
4
  "description": "The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).",
5
5
  "main": "./lib/switchbot.js",
6
6
  "files": [