node-switchbot 1.8.1-beta.3 → 1.8.1-beta.5

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 +2 -16
  2. package/package.json +1 -1
package/lib/switchbot.js CHANGED
@@ -207,14 +207,7 @@ 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
+ emitter.setMaxListeners(0)
218
211
  if (state === "poweredOn") {
219
212
  resolve();
220
213
  } else {
@@ -383,14 +376,7 @@ class Switchbot {
383
376
  },
384
377
  false
385
378
  );
386
- require("events").EventEmitter.prototype._maxListeners = 1000;
387
- require("events").defaultMaxListeners = 1000;
388
-
389
- process.on("warning", function (err) {
390
- if ("MaxListenersExceededWarning" == err.name) {
391
- console.log("MaxListenersExceededWarning");
392
- }
393
- });
379
+ emitter.setMaxListeners(0)
394
380
  if (!valid) {
395
381
  reject(new Error(parameterChecker.error.message));
396
382
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-switchbot",
3
- "version": "1.8.1-beta.3",
3
+ "version": "1.8.1-beta.5",
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": [