homebridge-enphase-envoy 10.2.5 → 10.2.6-beta.1

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "private": false,
3
3
  "displayName": "Enphase Envoy",
4
4
  "name": "homebridge-enphase-envoy",
5
- "version": "10.2.5",
5
+ "version": "10.2.6-beta.1",
6
6
  "description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
7
7
  "license": "MIT",
8
8
  "author": "grzegorz914",
package/src/envoydata.js CHANGED
@@ -2052,9 +2052,9 @@ class EnvoyData extends EventEmitter {
2052
2052
  // update encharges
2053
2053
  const enchargesRealPowerSummary = [];
2054
2054
  const encharges = this.pv.inventory.esubs.encharges.devices || [];
2055
- for (const encharge of encharges) {
2056
- const serialNumber = encharge.serialNumber;
2057
- const device = devices.find(device => device.serial_num === serialNumber);
2055
+ for (const device of devices) {
2056
+ const serialNumber = device.serial_num;
2057
+ const encharge = encharges.find(device => device.serialNumber === serialNumber);
2058
2058
  if (this.logDebug) this.emit('debug', `Ensemble device power:`, device);
2059
2059
  if (!device) continue;
2060
2060
 
@@ -4867,6 +4867,8 @@ class EnvoyDevice extends EventEmitter {
4867
4867
 
4868
4868
  // Add dry contacts
4869
4869
  if (enpowersDryContactsSupported && Array.isArray(enpower.dryContacts)) {
4870
+ if (this.logDebug) this.emit('debug', `Requesting enpowers dry contacts data`);
4871
+
4870
4872
  enpower.dryContacts.forEach((contact, i) => {
4871
4873
  const dryContactData = {
4872
4874
  id: contact.id,
@@ -4882,6 +4884,8 @@ class EnvoyDevice extends EventEmitter {
4882
4884
 
4883
4885
  // Add dry contacts settings
4884
4886
  if (enpowersDryContactsSettingsSupported && contact.settings) {
4887
+ if (this.logDebug) this.emit('debug', `Requesting enpowers dry contacts settings data`);
4888
+
4885
4889
  const settings = contact.settings;
4886
4890
  dryContactData.settings = {
4887
4891
  type: ApiCodes[settings.type] ?? settings.type,
@@ -4906,7 +4910,7 @@ class EnvoyDevice extends EventEmitter {
4906
4910
  };
4907
4911
  }
4908
4912
 
4909
- this.pv.inventoryData.esubs.dryContacts[i] = dryContactData;
4913
+ this.pv.inventoryData.esubs.enpowers[index].dryContacts[i] = dryContactData;
4910
4914
  });
4911
4915
  }
4912
4916