homebridge-enphase-envoy 10.2.5-beta.4 → 10.2.5-beta.6
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 +1 -1
- package/src/energymeter.js +3 -3
- package/src/envoydata.js +3 -3
- package/src/functions.js +3 -3
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-beta.
|
|
5
|
+
"version": "10.2.5-beta.6",
|
|
6
6
|
"description": "Homebridge p7ugin for Photovoltaic Energy System manufactured by Enphase.",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "grzegorz914",
|
package/src/energymeter.js
CHANGED
|
@@ -482,7 +482,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
482
482
|
const jwt = this.feature.info.jwtToken;
|
|
483
483
|
|
|
484
484
|
// Create a token-authenticated Axios instance
|
|
485
|
-
const axiosInstance = this.functions.createAxiosInstance(`Bearer ${jwt.token}`, null);
|
|
485
|
+
const axiosInstance = this.functions.createAxiosInstance(this.url, `Bearer ${jwt.token}`, null);
|
|
486
486
|
|
|
487
487
|
// Send validation request
|
|
488
488
|
const response = await axiosInstance.get(ApiUrls.CheckJwt);
|
|
@@ -503,7 +503,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
503
503
|
}
|
|
504
504
|
|
|
505
505
|
// Replace axios instance with cookie-authenticated one
|
|
506
|
-
this.axiosInstance = this.functions.createAxiosInstance(null, cookie);
|
|
506
|
+
this.axiosInstance = this.functions.createAxiosInstance(this.url, null, cookie);
|
|
507
507
|
|
|
508
508
|
// Update internal state
|
|
509
509
|
this.feature.info.tokenValid = true;
|
|
@@ -1166,7 +1166,7 @@ class EnergyMeter extends EventEmitter {
|
|
|
1166
1166
|
|
|
1167
1167
|
try {
|
|
1168
1168
|
// Create axios instance
|
|
1169
|
-
this.axiosInstance = this.functions.createAxiosInstance();
|
|
1169
|
+
this.axiosInstance = this.functions.createAxiosInstance(this.url);
|
|
1170
1170
|
|
|
1171
1171
|
// Get basic PV info
|
|
1172
1172
|
const getInfo = await this.getInfo();
|
package/src/envoydata.js
CHANGED
|
@@ -713,7 +713,7 @@ class EnvoyData extends EventEmitter {
|
|
|
713
713
|
const jwt = this.feature.info.jwtToken;
|
|
714
714
|
|
|
715
715
|
// Create a token-authenticated Axios instance
|
|
716
|
-
const axiosInstance = this.functions.createAxiosInstance(`Bearer ${jwt.token}`, null);
|
|
716
|
+
const axiosInstance = this.functions.createAxiosInstance(this.url, `Bearer ${jwt.token}`, null);
|
|
717
717
|
|
|
718
718
|
// Send validation request
|
|
719
719
|
const response = await axiosInstance.get(ApiUrls.CheckJwt);
|
|
@@ -734,7 +734,7 @@ class EnvoyData extends EventEmitter {
|
|
|
734
734
|
}
|
|
735
735
|
|
|
736
736
|
// Replace axios instance with cookie-authenticated one
|
|
737
|
-
this.axiosInstance = this.functions.createAxiosInstance(null, cookie);
|
|
737
|
+
this.axiosInstance = this.functions.createAxiosInstance(this.url, null, cookie);
|
|
738
738
|
|
|
739
739
|
// Update internal state
|
|
740
740
|
this.feature.info.tokenValid = true;
|
|
@@ -2732,7 +2732,7 @@ class EnvoyData extends EventEmitter {
|
|
|
2732
2732
|
|
|
2733
2733
|
try {
|
|
2734
2734
|
// Create axios instance
|
|
2735
|
-
this.axiosInstance = this.functions.createAxiosInstance();
|
|
2735
|
+
this.axiosInstance = this.functions.createAxiosInstance(this.url);
|
|
2736
2736
|
|
|
2737
2737
|
// Get basic PV info
|
|
2738
2738
|
const getInfo = await this.getInfo();
|
package/src/functions.js
CHANGED
|
@@ -113,9 +113,9 @@ class Functions {
|
|
|
113
113
|
return powerPeakStored;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
createAxiosInstance(authHeader = null, cookie = null) {
|
|
116
|
+
createAxiosInstance(url, authHeader = null, cookie = null) {
|
|
117
117
|
return axios.create({
|
|
118
|
-
baseURL:
|
|
118
|
+
baseURL: url,
|
|
119
119
|
headers: {
|
|
120
120
|
Accept: 'application/json',
|
|
121
121
|
...(authHeader ? { Authorization: authHeader } : {}),
|
|
@@ -123,7 +123,7 @@ class Functions {
|
|
|
123
123
|
},
|
|
124
124
|
withCredentials: true,
|
|
125
125
|
httpsAgent: new Agent({
|
|
126
|
-
keepAlive:
|
|
126
|
+
keepAlive: true,
|
|
127
127
|
rejectUnauthorized: false
|
|
128
128
|
}),
|
|
129
129
|
timeout: 60000
|