homebridge-tauron-elicznik 0.0.2-beta61 → 0.0.2-beta65

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
@@ -136,8 +136,7 @@ class eLicznikDevice {
136
136
 
137
137
  const data = {
138
138
  username: this.user,
139
- password: this.passwd,
140
- service: SERVICE_URL
139
+ password: this.passwd
141
140
  };
142
141
 
143
142
 
@@ -208,7 +207,7 @@ class eLicznikDevice {
208
207
  };
209
208
  const response = await this.tauronAuth.request(options);
210
209
 
211
- this.log(response)
210
+ this.log(response);
212
211
  const energyImport = 0;
213
212
  const energyExport = 0;
214
213
  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-beta61",
4
+ "version": "0.0.2-beta65",
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
@@ -2,6 +2,7 @@
2
2
  const axios = require('axios');
3
3
 
4
4
  const LOGIN_URL = 'https://logowanie.tauron-dystrybucja.pl/login?service=https://elicznik.tauron-dystrybucja.pl';
5
+ const SERVICE_URL = 'https://elicznik.tauron-dystrybucja.pl';
5
6
 
6
7
  class axiosTauronAuth {
7
8
  constructor({
@@ -9,15 +10,13 @@ class axiosTauronAuth {
9
10
  }) {
10
11
  this.username = data.username;
11
12
  this.password = data.password;
12
- this.service = data.service;
13
13
  }
14
14
 
15
15
  async request() {
16
16
  try {
17
17
  const data = {
18
18
  username: this.username,
19
- password: this.password,
20
- service: this.service
19
+ password: this.password
21
20
  };
22
21
 
23
22
  const options = {
@@ -25,10 +24,11 @@ class axiosTauronAuth {
25
24
  data: data
26
25
  };
27
26
  const response = await axios.post(options);
28
- console.log(response)
29
- return response;
30
- } catch (err) {}
31
- return err
27
+ console.log(response.data);
28
+ return response.data;
29
+ } catch (err) {
30
+ return err
31
+ }
32
32
  };
33
33
  }
34
34
  module.exports = axiosTauronAuth;