homebridge-tauron-elicznik 0.0.2-beta71 → 0.0.2-beta75

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 CHANGED
@@ -135,13 +135,11 @@ class eLicznikDevice {
135
135
  this.energyExport = 0;
136
136
 
137
137
  const data = {
138
- log: this.log,
139
138
  username: this.user,
140
139
  password: this.passwd,
141
140
  service: SERVICE_URL
142
141
  };
143
142
 
144
-
145
143
  //auth
146
144
  this.tauronAuth = new axiosTauronAuth({
147
145
  data: data
@@ -194,11 +192,7 @@ class eLicznikDevice {
194
192
  try {
195
193
  const url = CHARTS_URL + '?dane[chartYear]=2021&dane[paramType]=year&dane[checkOZE]=on&dane[smartNr]=' + this.meterId;
196
194
 
197
- const options = {
198
- method: 'POST',
199
- url: url
200
- };
201
- const response = await this.tauronAuth.request(options);
195
+ const response = await this.tauronAuth.request(url);
202
196
 
203
197
  this.log('11112222', response.data);
204
198
  const energyImport = 0;
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-beta71",
4
+ "version": "0.0.2-beta75",
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,27 +8,27 @@ class axiosTauronAuth {
8
8
  constructor({
9
9
  data
10
10
  }) {
11
- this.log = data.log;
12
11
  this.username = data.username;
13
12
  this.password = data.password;
13
+ this.service = data.service;
14
14
  }
15
15
 
16
- async request(returnUrl) {
16
+ async request() {
17
17
  try {
18
18
  const data = {
19
19
  username: this.username,
20
20
  password: this.password,
21
- service: SERVICE_URL
21
+ service: this.service
22
22
  };
23
23
 
24
24
  const options = {
25
25
  data: data
26
26
  };
27
27
  const response = await axios.post(LOGIN_URL, options);
28
- this.log('aaaaaaaaa', response.data);
29
- returnUrl.url = response.data;
28
+ const returnUrl = response.data;
29
+ console.log('aaaaaaaaa', returnUrl);
30
30
 
31
- return response.data;
31
+ return returnUrl;
32
32
  } catch (err) {
33
33
  return err
34
34
  }