homebridge-enphase-envoy 10.3.0-beta.3 → 10.3.0-beta.4

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/CHANGELOG.md CHANGED
@@ -13,9 +13,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
 
14
14
  ## Changes
15
15
 
16
- - added support for Eve Energy Meter (Production, Consumption Net, Consumption Total)
16
+ - extend Eve Energy Meter to support (Production, Consumption Net, Consumption Total)
17
+ - fix [#218](https://github.com/grzegorz914/homebridge-enphase-envoy/issues/218)
17
18
  - stability and performance improvements
18
- - config chema updated
19
+ - config schema updated
19
20
  - readme updated
20
21
  - cleanup
21
22
 
package/index.js CHANGED
@@ -103,9 +103,9 @@ class EnvoyPlatform {
103
103
  .on('warn', (msg) => logLevel.warn && log.warn(`Device: ${host} ${deviceName}, ${msg}`))
104
104
  .on('error', (msg) => logLevel.error && log.error(`Device: ${host} ${deviceName}, ${msg}`));
105
105
 
106
- const accessory = await envoyDevice.start();
107
- if (accessory) {
108
- api.publishExternalAccessories(PluginName, accessory);
106
+ const accessories = await envoyDevice.start();
107
+ if (accessories) {
108
+ api.publishExternalAccessories(PluginName, accessories);
109
109
  if (logLevel.success) log.success(`Device: ${host} ${deviceName}, Published as external accessory.`);
110
110
 
111
111
  await impulseGenerator.state(false);
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.0-beta.3",
5
+ "version": "10.3.0-beta.4",
6
6
  "description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
7
7
  "license": "MIT",
8
8
  "author": "grzegorz914",
@@ -786,7 +786,7 @@ class EnvoyDevice extends EventEmitter {
786
786
  const devices = this.energyMeter ? 2 : 1;
787
787
  for (let i = 0; i < devices; i++) {
788
788
  switch (i) {
789
- case 0://PV
789
+ case 0: //PV System
790
790
  const envoySerialNumber = this.pv.info.serialNumber;
791
791
  const accessoryName = this.name;
792
792
 
@@ -2158,7 +2158,7 @@ class EnvoyDevice extends EventEmitter {
2158
2158
  if (this.enchargeBackupLevelSummarySensors.length > 0) {
2159
2159
  if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} Backup Level Sensor Services`);
2160
2160
 
2161
- this.enchargeBackupLevelSummarySensorServices = [];
2161
+ this.enchargeBackupLevelSummarySensorsServices = [];
2162
2162
  for (let i = 0; i < this.enchargeBackupLevelSummarySensors.length; i++) {
2163
2163
  const sensor = this.enchargeBackupLevelSummarySensors[i];
2164
2164
  const { namePrefix, name, serviceType, characteristicType } = sensor;
@@ -2174,13 +2174,13 @@ class EnvoyDevice extends EventEmitter {
2174
2174
  return currentState;
2175
2175
  });
2176
2176
 
2177
- this.enchargeBackupLevelSummarySensorServices.push(sensorService);
2177
+ this.enchargeBackupLevelSummarySensorsServices.push(sensorService);
2178
2178
  }
2179
2179
  }
2180
2180
 
2181
2181
  //devices
2182
2182
  this.enchargeServices = [];
2183
- this.enchargeBackupLevelServices = [];
2183
+ this.enchargeBackupLevelControlServices = [];
2184
2184
 
2185
2185
  for (const encharge of this.pv.inventoryData.esubs.encharges.devices) {
2186
2186
  const serialNumber = encharge.serialNumber;
@@ -2231,7 +2231,7 @@ class EnvoyDevice extends EventEmitter {
2231
2231
  return currentChargeState;
2232
2232
  });
2233
2233
 
2234
- this.enchargeBackupLevelServices.push(controlService);
2234
+ this.enchargeBackupLevelControlServices.push(controlService);
2235
2235
  }
2236
2236
 
2237
2237
  if (this.logDebug) this.emit('debug', `Prepare ${enchargeName} ${serialNumber} Service`);
@@ -3002,7 +3002,7 @@ class EnvoyDevice extends EventEmitter {
3002
3002
 
3003
3003
  accessories.push(accessory);
3004
3004
  break;
3005
- case 1: //Energy Meter Production
3005
+ case 1: //EVE Energy Meter
3006
3006
  this.fakegatoHistoryServices = [];
3007
3007
  this.energyMeterServices = [];
3008
3008
  for (const source of this.pv.powerAndEnergyData.data) {
@@ -4435,7 +4435,7 @@ class EnvoyDevice extends EventEmitter {
4435
4435
  for (const { type, value, valueKey } of characteristics) {
4436
4436
  if (!this.functions.isValidValue(value)) continue;
4437
4437
  sensor[valueKey] = value;
4438
- this.enchargeBackupLevelSummarySensorServices?.[i]?.updateCharacteristic(type, value);
4438
+ this.enchargeBackupLevelSummarySensorsServices?.[i]?.updateCharacteristic(type, value);
4439
4439
  };
4440
4440
  }
4441
4441
  }
@@ -4784,7 +4784,7 @@ class EnvoyDevice extends EventEmitter {
4784
4784
  for (const { type, value, valueKey } of characteristics1) {
4785
4785
  if (!this.functions.isValidValue(value)) continue;
4786
4786
  control[valueKey] = value;
4787
- this.enchargeBackupLevelServices?.[index]?.updateCharacteristic(type, value);
4787
+ this.enchargeBackupLevelControlServices?.[index]?.updateCharacteristic(type, value);
4788
4788
  }
4789
4789
  }
4790
4790
 
@@ -5168,8 +5168,8 @@ class EnvoyDevice extends EventEmitter {
5168
5168
  // Update enpower grid mode sensors
5169
5169
  for (let i = 0; i < (this.enpowerGridModeSensors?.length ?? 0); i++) {
5170
5170
  const sensor = this.enpowerGridModeSensors[i];
5171
- const { characteristicType } = sensor;
5172
- const state = sensor.gridMode === enpowerData.enpwrGridMode;
5171
+ const { characteristicType, gridMode } = sensor;
5172
+ const state = gridMode === enpowerData.enpwrGridMode;
5173
5173
 
5174
5174
  // Create characteristics
5175
5175
  const characteristics = [
@@ -5711,7 +5711,7 @@ class EnvoyDevice extends EventEmitter {
5711
5711
  for (const { type, value, valueKey } of characteristics) {
5712
5712
  if (!this.functions.isValidValue(value)) continue;
5713
5713
  sensor[valueKey] = value;
5714
- this.enchargeBackupLevelSummarySensorServices?.[i]?.updateCharacteristic(type, value);
5714
+ this.enchargeBackupLevelSummarySensorsServices?.[i]?.updateCharacteristic(type, value);
5715
5715
  };
5716
5716
  }
5717
5717
  }
@@ -5785,8 +5785,8 @@ class EnvoyDevice extends EventEmitter {
5785
5785
  if (this.restFul.enable || this.mqtt.enable) await this.externalIntegrations();
5786
5786
 
5787
5787
  // Prepare HomeKit accessory
5788
- const accessory = await this.prepareAccessory();
5789
- return accessory;
5788
+ const accessories = await this.prepareAccessory();
5789
+ return accessories;
5790
5790
  } catch (error) {
5791
5791
  throw new Error(`Start error: ${error}`);
5792
5792
  }