homebridge-enphase-envoy 10.3.1-beta.6 → 10.3.1-beta.8

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.3.1-beta.6",
5
+ "version": "10.3.1-beta.8",
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
@@ -906,17 +906,18 @@ class EnvoyData extends EventEmitter {
906
906
  const home = response.data;
907
907
  if (this.logDebug) this.emit('debug', 'Home:', home);
908
908
 
909
- const comm = home.comm ?? {};
910
909
  const network = home.network ?? {};
911
- const networkInterfaces = (network.interfaces ?? []).filter(iface => iface.ip !== '169.254.120.1');
912
- const wirelessConnections = (home.wireless_connection ?? []).filter(kit => kit.signal_strength_max > 0);
910
+ network.interfaces = (network.interfaces ?? []).filter(iface => iface.carrier === true || iface.ip !== '169.254.120.1');
911
+ home.wireless_connection = (home.wireless_connection ?? []).filter(kit => kit.signal_strength_max > 0);
913
912
 
914
913
  // Communication device support flags
915
- const microinvertersSupported = 'pcu' in comm;
916
- const acBatteriesSupported = 'acb' in comm;
917
- const qRelaysSupported = 'nsrb' in comm;
918
- const ensemblesSupported = 'esub' in comm;
919
- const enchargesSupported = 'encharge' in comm;
914
+ const microinvertersSupported = 'pcu' in home.comm;
915
+ const acBatteriesSupported = 'acb' in home.comm;
916
+ const qRelaysSupported = 'nsrb' in home.comm;
917
+ const ensemblesSupported = 'esub' in home.comm;
918
+ const enchargesSupported = 'encharge' in home.comm;
919
+ const networkInterfacesSupported = 'interfaces' in network;
920
+ const wirelessConnectionsSupported = 'wireless_connection' in home;
920
921
  this.pv.home = home;
921
922
 
922
923
  // Update feature flags
@@ -926,13 +927,13 @@ class EnvoyData extends EventEmitter {
926
927
  this.feature.inventory.esubs.supported = ensemblesSupported;
927
928
  this.feature.inventory.esubs.encharges.supported = enchargesSupported;
928
929
 
929
- this.feature.home.networkInterfaces.supported = networkInterfaces.length > 0;
930
- this.feature.home.networkInterfaces.installed = networkInterfaces.some(i => i.carrier);
931
- this.feature.home.networkInterfaces.count = networkInterfaces.length;
930
+ this.feature.home.networkInterfaces.supported = networkInterfacesSupported;
931
+ this.feature.home.networkInterfaces.installed = network.interfaces.length > 0;
932
+ this.feature.home.networkInterfaces.count = network.interfaces.length;
932
933
 
933
- this.feature.home.wirelessConnections.supported = wirelessConnections.length > 0;
934
- this.feature.home.wirelessConnections.installed = wirelessConnections.some(w => w.connected);
935
- this.feature.home.wirelessConnections.count = wirelessConnections.length;
934
+ this.feature.home.wirelessConnections.supported = wirelessConnectionsSupported;
935
+ this.feature.home.wirelessConnections.installed = home.wireless_connection.length > 0;
936
+ this.feature.home.wirelessConnections.count = home.wireless_connection.length;
936
937
  this.feature.home.supported = true;
937
938
 
938
939
  // RESTful + MQTT
@@ -3206,6 +3206,7 @@ class EnvoyDevice extends EventEmitter {
3206
3206
  const network = home.network ?? {};
3207
3207
  const wirelessConnections = home.wireless_connection ?? [];
3208
3208
  const networkInterfaces = network.interfaces ?? []
3209
+
3209
3210
  // Communication device support flags
3210
3211
  const commEnsemble = comm.esub ?? {};
3211
3212
  const commEncharges = Array.isArray(comm.encharge) ? comm.encharge : [];