homebridge-enphase-envoy 9.6.3 → 9.6.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
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [9.6.4] - (02.12.2024)
9
+
10
+ ## Changes
11
+
12
+ - prevent crasch if PLC Level is enabled and credentials data is not installer
13
+
8
14
  ## [9.6.3] - (02.12.2024)
9
15
 
10
16
  ## Changes
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.6.3",
5
+ "version": "9.6.4",
6
6
  "description": "Homebridge plugin for Photovoltaic Energy System manufactured by Enphase.",
7
7
  "license": "MIT",
8
8
  "author": "grzegorz914",
@@ -3929,6 +3929,13 @@ class EnvoyDevice extends EventEmitter {
3929
3929
  const mqtt = this.mqttConnected ? this.mqtt.emit('publish', 'PLC Level', plcLevel) : false;
3930
3930
  return true;
3931
3931
  } catch (error) {
3932
+ const errorString = error.toString();
3933
+ const tokenNotValid = errorString.includes('status code 401');
3934
+ if (tokenNotValid) {
3935
+ this.emit('warn', 'PLC level will not work, you need installer credentials data.')
3936
+ return false;
3937
+ }
3938
+
3932
3939
  throw new Error(`Update plc level error: ${error.message || error}`);
3933
3940
  };
3934
3941
  };