homebridge-tauron-elicznik 0.0.2-beta77 → 0.0.2-beta80

Sign up to get free protection for your applications and to get access to all the features.
package/index.js CHANGED
@@ -192,10 +192,19 @@ class eLicznikDevice {
192
192
  try {
193
193
  const url = CHARTS_URL + '?dane[chartYear]=2021&dane[paramType]=year&dane[checkOZE]=on&dane[smartNr]=' + this.meterId;
194
194
 
195
- const response = await this.tauronAuth.request(url);
196
-
197
- this.log('11112222', this.tauronAuth.request());
198
- this.log('33333344', response.data);
195
+ const data = {
196
+ username: this.username,
197
+ password: this.password,
198
+ service: SERVICE_URL
199
+ };
200
+ const options = {
201
+ data: data
202
+ };
203
+ const response = await axios.post(LOGIN_URL, options);
204
+
205
+ //const response = await this.tauronAuth.request(url);
206
+
207
+ this.log('33333344', response, response.data);
199
208
  const energyImport = 0;
200
209
  const energyExport = 0;
201
210
  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-beta77",
4
+ "version": "0.0.2-beta80",
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
@@ -13,7 +13,7 @@ class axiosTauronAuth {
13
13
  this.service = data.service;
14
14
  }
15
15
 
16
- async request() {
16
+ async request(returnUrl) {
17
17
  try {
18
18
  const data = {
19
19
  username: this.username,
@@ -25,7 +25,7 @@ class axiosTauronAuth {
25
25
  data: data
26
26
  };
27
27
  const response = await axios.post(LOGIN_URL, options);
28
- const returnUrl = response.data;
28
+ returnUrl = response.data;
29
29
 
30
30
  return returnUrl;
31
31
  } catch (err) {