homebridge-tauron-elicznik 0.0.2-beta73 → 0.0.2-beta77
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/index.js +3 -7
- package/package.json +1 -1
- package/src/tauronAuth.js +5 -4
package/index.js
CHANGED
@@ -140,7 +140,6 @@ class eLicznikDevice {
|
|
140
140
|
service: SERVICE_URL
|
141
141
|
};
|
142
142
|
|
143
|
-
|
144
143
|
//auth
|
145
144
|
this.tauronAuth = new axiosTauronAuth({
|
146
145
|
data: data
|
@@ -193,13 +192,10 @@ class eLicznikDevice {
|
|
193
192
|
try {
|
194
193
|
const url = CHARTS_URL + '?dane[chartYear]=2021&dane[paramType]=year&dane[checkOZE]=on&dane[smartNr]=' + this.meterId;
|
195
194
|
|
196
|
-
const
|
197
|
-
method: 'POST',
|
198
|
-
url: url
|
199
|
-
};
|
200
|
-
const response = await this.tauronAuth.request(options);
|
195
|
+
const response = await this.tauronAuth.request(url);
|
201
196
|
|
202
|
-
this.log('11112222',
|
197
|
+
this.log('11112222', this.tauronAuth.request());
|
198
|
+
this.log('33333344', response.data);
|
203
199
|
const energyImport = 0;
|
204
200
|
const energyExport = 0;
|
205
201
|
if (this.tauroneLicznikEnergyService) {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"displayName": "Tauron eLicznik",
|
3
3
|
"name": "homebridge-tauron-elicznik",
|
4
|
-
"version": "0.0.2-
|
4
|
+
"version": "0.0.2-beta77",
|
5
5
|
"description": "Homebridge plugin (https://github.com/homebridge/homebridge) to read data from Tauron eLicznik.",
|
6
6
|
"license": "MIT",
|
7
7
|
"author": "grzegorz914",
|
package/src/tauronAuth.js
CHANGED
@@ -10,23 +10,24 @@ class axiosTauronAuth {
|
|
10
10
|
}) {
|
11
11
|
this.username = data.username;
|
12
12
|
this.password = data.password;
|
13
|
+
this.service = data.service;
|
13
14
|
}
|
14
15
|
|
15
|
-
async request(
|
16
|
+
async request() {
|
16
17
|
try {
|
17
18
|
const data = {
|
18
19
|
username: this.username,
|
19
20
|
password: this.password,
|
20
|
-
service:
|
21
|
+
service: this.service
|
21
22
|
};
|
22
23
|
|
23
24
|
const options = {
|
24
25
|
data: data
|
25
26
|
};
|
26
27
|
const response = await axios.post(LOGIN_URL, options);
|
27
|
-
|
28
|
+
const returnUrl = response.data;
|
28
29
|
|
29
|
-
return
|
30
|
+
return returnUrl;
|
30
31
|
} catch (err) {
|
31
32
|
return err
|
32
33
|
}
|