homebridge-tauron-elicznik 0.0.2-beta72 → 0.0.2-beta76

Sign up to get free protection for your applications and to get access to all the features.
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,13 +192,10 @@ 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
- this.log('11112222', response.data);
197
+ this.log('11112222', this.tauronAuth.request);
198
+ this.log('33333344', response.data);
204
199
  const energyImport = 0;
205
200
  const energyExport = 0;
206
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-beta72",
4
+ "version": "0.0.2-beta76",
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,25 +8,24 @@ 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
- console.log('aaaaaaaaa', response.data);
29
- returnUrl = response.data;
28
+ const returnUrl = response.data;
30
29
 
31
30
  return returnUrl;
32
31
  } catch (err) {