Skip to content

Commit

Permalink
Increase maxEventListeners on unit object (effectively maximum connec…
Browse files Browse the repository at this point in the history
…ted devices) from 10 to 100
  • Loading branch information
Joolee committed Feb 28, 2022
1 parent eadc3d5 commit d40a915
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ESPEasyUnit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d40a915

Please sign in to comment.