homebridge-tauron-elicznik 0.0.2-beta89 → 0.0.2-beta92

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.
Files changed (2) hide show
  1. package/index.js +3 -12
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,9 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('path');
4
- const httpclient = require('urllib');
4
+ const urllib = require('urllib');
5
5
  const fs = require('fs');
6
- const { SSL_OP_ALL } = require('constants');
7
6
  const fsPromises = fs.promises;
8
7
 
9
8
  const PLUGIN_NAME = 'homebridge-tauron-elicznik';
@@ -182,10 +181,6 @@ class eLicznikDevice {
182
181
 
183
182
  const token = Buffer.from(`${this.user}:${this.passwd}`, 'utf8').toString('base64')
184
183
 
185
- const agent = new https.Agent({
186
- rejectUnauthorized: false
187
- });
188
-
189
184
  const payload = {
190
185
  username: this.user,
191
186
  password: this.passwd,
@@ -194,13 +189,9 @@ class eLicznikDevice {
194
189
  const options = {
195
190
  method: 'POST',
196
191
  data: payload,
197
- httpsAgent: true,
198
- ciphers: 'DEFAULT@SECLEVEL=1',
199
- headers: {
200
- 'Content-Type': 'application/x-www-form-urlencoded'
201
- },
192
+ headers: HEADERS
202
193
  };
203
- const response = httpclient(LOGIN_URL, options);
194
+ const response = urllib.request(LOGIN_URL, options);
204
195
 
205
196
  this.log('33333344', response);
206
197
  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-beta89",
4
+ "version": "0.0.2-beta92",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to read data from Tauron eLicznik.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",