From d40a915a2664972cf2ce6970dcb53e2f9b1973e1 Mon Sep 17 00:00:00 2001 From: Joolee <570302+Joolee@users.noreply.github.com> Date: Mon, 28 Feb 2022 17:32:16 +0100 Subject: [PATCH] Increase maxEventListeners on unit object (effectively maximum connected devices) from 10 to 100 --- lib/ESPEasyUnit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ESPEasyUnit.js b/lib/ESPEasyUnit.js index 070e8ce..d7e8f78 100644 --- a/lib/ESPEasyUnit.js +++ b/lib/ESPEasyUnit.js @@ -34,6 +34,13 @@ module.exports = class ESPEasyUnit extends Homey.SimpleClass { this.sensors = []; this.mac = mac; + // Set maximum listeners for this clas to a reasonable 100 + // Every device will listen to jsonUpdate, event, settingsUpdate, stateChange + // GPIO devices listen to pinUpdate and boardTypeChanged + // This limit is per event type + // Max number of devices per unit should be 32 tasks + ~60 GPIO pins + this.setMaxListeners(100); + this.on('event', this.logEvent.bind(this)) this.updateJSON(false, (error) => { this.onInit(error, callback);