homebridge-enphase-envoy 9.4.3-beta.21 → 9.4.3-beta.23

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/envoydevice.js +13 -13
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": "9.4.3-beta.21",
5
+ "version": "9.4.3-beta.23",
6
6
  "description": "Homebridge plugin for Photovoltaic Energy System manufactured by Enphase.",
7
7
  "license": "MIT",
8
8
  "author": "grzegorz914",
@@ -29,7 +29,7 @@
29
29
  ],
30
30
  "engines": {
31
31
  "homebridge": "^1.6.0 || ^2.0.0-beta.0",
32
- "node": "^18.20.4 || ^20.15.1 || ^22.7.0"
32
+ "node": "^18.20.4 || ^20.15.1 || ^22.7.0|| ^23.2.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "async-mqtt": "^2.6.3",
@@ -4529,7 +4529,7 @@ class EnvoyDevice extends EventEmitter {
4529
4529
  try {
4530
4530
  const tokenValid = await this.checkJwtToken();
4531
4531
  const setStatet = tokenValid && state ? await this.updateCommLevel() : false;
4532
- const info = this.disableLogInfo ? false : this.emit('message', `Envoy: ${serialNumber}, check plc level: ${setStatet ? `Yes` : `No`}`);
4532
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Envoy: ${serialNumber}, check plc level: ${setStatet ? `Yes` : `No`}`);
4533
4533
  } catch (error) {
4534
4534
  this.emit('warn', `Envoy: ${serialNumber}, check plc level error: ${error}`);
4535
4535
  };
@@ -4547,7 +4547,7 @@ class EnvoyDevice extends EventEmitter {
4547
4547
  const tokenValid = await this.checkJwtToken();
4548
4548
  const prductionState = await this.updateProductionPowerState();
4549
4549
  const setState = tokenValid && (state !== prductionState) ? await this.setProductionPowerState(state) : false;
4550
- const debug = this.enableDebugMode ? this.emit('debug', `Envoy: ${serialNumber}, set production power mode: ${setState ? 'Enabled' : 'Disabled'}`) : false;
4550
+ const debug = this.enableDebugMode || !tokenValid ? this.emit('debug', `Envoy: ${serialNumber}, set production power mode: ${setState ? 'Enabled' : 'Disabled'}`) : false;
4551
4551
  } catch (error) {
4552
4552
  this.emit('warn', `Envoy: ${serialNumber}, set production power mode error: ${error}`);
4553
4553
  };
@@ -4570,7 +4570,7 @@ class EnvoyDevice extends EventEmitter {
4570
4570
  try {
4571
4571
  const tokenValid = await this.checkJwtToken();
4572
4572
  const setState = tokenValid ? await this.setEnpowerGridState(state) : false;
4573
- const info = this.disableLogInfo ? false : this.emit('message', `Envoy: ${serialNumber}, set enpower grid state to: ${setState ? `Grid ON` : `Grid OFF`}`);
4573
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Envoy: ${serialNumber}, set enpower grid state to: ${setState ? `Grid ON` : `Grid OFF`}`);
4574
4574
  } catch (error) {
4575
4575
  this.emit('warn', `Set enpower grid state error: ${error}`);
4576
4576
  };
@@ -4593,8 +4593,8 @@ class EnvoyDevice extends EventEmitter {
4593
4593
  try {
4594
4594
  const genMode = state ? 'on' : 'off';
4595
4595
  const tokenValid = await this.checkJwtToken();
4596
- const setState = tokenValidd ? await this.setGeneratorMode(genMode) : false;
4597
- const info = this.disableLogInfo ? false : this.emit('message', `Envoy: ${serialNumber}, set generator state to: ${setState ? `ON` : `OFF`}`);
4596
+ const setState = tokenValid ? await this.setGeneratorMode(genMode) : false;
4597
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Envoy: ${serialNumber}, set generator state to: ${setState ? `ON` : `OFF`}`);
4598
4598
  } catch (error) {
4599
4599
  this.emit('warn', `Set generator state error: ${error}`);
4600
4600
  };
@@ -4622,7 +4622,7 @@ class EnvoyDevice extends EventEmitter {
4622
4622
  try {
4623
4623
  const tokenValid = await this.checkJwtToken();
4624
4624
  const setState = tokenValid && state ? await this.updateCommLevel() : false;
4625
- const info = this.disableLogInfo ? false : this.emit('message', `Set plc level control state to: ${setState ? `ON` : `OFF`}`);
4625
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set plc level control state to: ${setState ? `ON` : `OFF`}`);
4626
4626
  } catch (error) {
4627
4627
  this.emit('warn', `Set plc level control state error: ${error}`);
4628
4628
  };
@@ -4652,7 +4652,7 @@ class EnvoyDevice extends EventEmitter {
4652
4652
  try {
4653
4653
  const tokenValid = await this.checkJwtToken();
4654
4654
  const setState = tokenValid ? await this.setProductionPowerState(state) : false;
4655
- const info = this.disableLogInfo ? false : this.emit('message', `Set power production control state to: ${setState ? `ON` : `OFF`}`);
4655
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set power production control state to: ${setState ? `ON` : `OFF`}`);
4656
4656
  } catch (error) {
4657
4657
  this.emit('warn', `Set power production control state error: ${error}`);
4658
4658
  };
@@ -5935,7 +5935,7 @@ class EnvoyDevice extends EventEmitter {
5935
5935
  try {
5936
5936
  const tokenValid = await this.checkJwtToken();
5937
5937
  const set = tokenValid ? state ? await this.setEnchargeProfile(profile, enchargeSettings.reservedSoc, enchargeSettings.chargeFromGrid) : false : false;
5938
- const debug = this.enableDebugMode ? this.emit('debug', `Encharges set profile: ${profile}`) : false;
5938
+ const debug = this.enableDebugMode || !tokenValid ? this.emit('debug', `Encharges set profile: ${profile}`) : false;
5939
5939
  } catch (error) {
5940
5940
  this.emit('warn', `Encharges set profile: ${profile}, error: ${error}`);
5941
5941
  };
@@ -5955,7 +5955,7 @@ class EnvoyDevice extends EventEmitter {
5955
5955
  try {
5956
5956
  const tokenValid = await this.checkJwtToken();
5957
5957
  const set = tokenValid ? await this.setEnchargeProfile(profile, value, enchargeSettings.chargeFromGrid) : false;
5958
- const debug = this.enableDebugMode ? this.emit('debug', `Encharges set profile: ${profile}, reserve: ${value} %`) : false;
5958
+ const debug = this.enableDebugMode || !tokenValid ? this.emit('debug', `Encharges set profile: ${profile}, reserve: ${value} %`) : false;
5959
5959
  } catch (error) {
5960
5960
  this.emit('warn', `Encharges set profile: ${profile} reserve, error: ${error}`);
5961
5961
  };
@@ -6130,7 +6130,7 @@ class EnvoyDevice extends EventEmitter {
6130
6130
  try {
6131
6131
  const tokenValid = await this.checkJwtToken();
6132
6132
  const setState = tokenValid ? await this.setEnpowerGridState(state) : false;
6133
- const info = this.disableLogInfo ? false : this.emit('message', `Set Enpower: ${serialNumber}, grid state to: ${setState ? `Grid ON` : `Grid OFF`}`);
6133
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set Enpower: ${serialNumber}, grid state to: ${setState ? `Grid ON` : `Grid OFF`}`);
6134
6134
  } catch (error) {
6135
6135
  this.emit('warn', `Set Enpower: ${serialNumber}, grid state error: ${error}`);
6136
6136
  };
@@ -6202,7 +6202,7 @@ class EnvoyDevice extends EventEmitter {
6202
6202
  try {
6203
6203
  const tokenValid = await this.checkJwtToken();
6204
6204
  const setState = tokenValid ? await this.setDryContactState(controlId, state) : false;
6205
- const info = this.disableLogInfo ? false : this.emit('message', `Set Enpower: ${serialNumber}, ${controlName}, control state to: ${setState ? `Manual` : `Soc`}`);
6205
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set Enpower: ${serialNumber}, ${controlName}, control state to: ${setState ? `Manual` : `Soc`}`);
6206
6206
  } catch (error) {
6207
6207
  this.emit('warn', `Set ${controlName}, control state error: ${error}`);
6208
6208
  };
@@ -6345,7 +6345,7 @@ class EnvoyDevice extends EventEmitter {
6345
6345
  const genMode = state ? 'on' : 'off';
6346
6346
  const tokenValid = await this.checkJwtToken();
6347
6347
  const setState = tokenValid ? await this.setGeneratorMode(genMode) : false;
6348
- const info = this.disableLogInfo ? false : this.emit('message', `Set Generator: ${type}, state to: ${setState ? `ON` : `OFF`}`);
6348
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set Generator: ${type}, state to: ${setState ? `ON` : `OFF`}`);
6349
6349
  } catch (error) {
6350
6350
  this.emit('warn', `Set Generator: ${type}, state error: ${error}`);
6351
6351
  };
@@ -6397,7 +6397,7 @@ class EnvoyDevice extends EventEmitter {
6397
6397
  const genMode = this.generatorModeActiveControls[i].mode;
6398
6398
  const tokenValid = await this.checkJwtToken();
6399
6399
  const setState = tokenValid && state ? await this.setGeneratorMode(genMode) : false;
6400
- const info = this.disableLogInfo ? false : this.emit('message', `Set Generator: ${type}, mode to: ${genMode}`);
6400
+ const info = this.disableLogInfo || !tokenValid ? false : this.emit('message', `Set Generator: ${type}, mode to: ${genMode}`);
6401
6401
  } catch (error) {
6402
6402
  this.emit('warn', `Set Generator: ${type}, state error: ${error}`);
6403
6403
  };