homebridge-tauron-elicznik 0.0.2-beta54 → 0.0.2-beta58

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
@@ -142,15 +142,6 @@ class eLicznikDevice {
142
142
  service: SERVICE_URL
143
143
  };
144
144
 
145
- this.axiosInstance = axios.create({
146
- method: 'POST',
147
- baseURL: LOGIN_URL,
148
- data: options,
149
- headers: HEADERS,
150
- httpsAgent: new https.Agent({
151
- rejectUnauthorized: false
152
- }),
153
- });
154
145
 
155
146
  //digest auth installer
156
147
  this.tauronAuth = new axiosTauronAuth({
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-beta54",
4
+ "version": "0.0.2-beta58",
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
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
2
  const axios = require('axios');
3
- const qs = require('qs');
4
- let count = 0;
5
3
 
6
4
  class axiosTauronAuth {
7
5
  constructor({
8
6
  options
9
7
  }) {
10
- this.method = options.method;
11
8
  this.baseUrl = options.baseURL;
12
9
  this.username = options.username;
13
10
  this.password = options.password;
@@ -16,14 +13,17 @@ class axiosTauronAuth {
16
13
 
17
14
  async request() {
18
15
  try {
19
- const options = qs.stringify({
20
- method: this.method,
21
- baseURL: this.baseUrl,
16
+ const data = {
22
17
  username: this.username,
23
18
  password: this.password,
24
19
  service: this.service
25
- });
26
- const response = await axios(options);
20
+ };
21
+
22
+ const options = {
23
+ baseURL: this.baseUrl,
24
+ data: data
25
+ };
26
+ const response = await axios.post(options);
27
27
  console.log(response)
28
28
  return response;
29
29
  } catch (err) {}