homebridge-tauron-elicznik 0.0.2-beta64 → 0.0.2-beta68
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +4 -8
- package/package.json +1 -1
- package/src/tauronAuth.js +7 -3
package/index.js
CHANGED
@@ -135,8 +135,10 @@ class eLicznikDevice {
|
|
135
135
|
this.energyExport = 0;
|
136
136
|
|
137
137
|
const data = {
|
138
|
+
log: this.log,
|
138
139
|
username: this.user,
|
139
|
-
password: this.passwd
|
140
|
+
password: this.passwd,
|
141
|
+
service: SERVICE_URL
|
140
142
|
};
|
141
143
|
|
142
144
|
|
@@ -193,14 +195,8 @@ class eLicznikDevice {
|
|
193
195
|
try {
|
194
196
|
const options = {
|
195
197
|
method: 'POST',
|
196
|
-
url:
|
198
|
+
url: url,
|
197
199
|
headers: HEADERS,
|
198
|
-
data: {
|
199
|
-
"dane[chartYear]": '2021',
|
200
|
-
"dane[paramType]": 'year',
|
201
|
-
"dane[smartNr]": this.meterId,
|
202
|
-
"dane[checkOZE]": 'on'
|
203
|
-
},
|
204
200
|
httpsAgent: new https.Agent({
|
205
201
|
rejectUnauthorized: false
|
206
202
|
}),
|
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-beta68",
|
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
@@ -8,16 +8,18 @@ class axiosTauronAuth {
|
|
8
8
|
constructor({
|
9
9
|
data
|
10
10
|
}) {
|
11
|
+
this.log = data.log;
|
11
12
|
this.username = data.username;
|
12
13
|
this.password = data.password;
|
14
|
+
this.service = data.service;
|
13
15
|
}
|
14
16
|
|
15
|
-
async request() {
|
17
|
+
async request(returnUrl) {
|
16
18
|
try {
|
17
19
|
const data = {
|
18
20
|
username: this.username,
|
19
21
|
password: this.password,
|
20
|
-
service:
|
22
|
+
service: this.service
|
21
23
|
};
|
22
24
|
|
23
25
|
const options = {
|
@@ -25,7 +27,9 @@ class axiosTauronAuth {
|
|
25
27
|
data: data
|
26
28
|
};
|
27
29
|
const response = await axios.post(options);
|
28
|
-
|
30
|
+
this.log(response.data);
|
31
|
+
returnUrl.url = response.data;
|
32
|
+
|
29
33
|
return response.data;
|
30
34
|
} catch (err) {
|
31
35
|
return err
|