homebridge-tauron-elicznik 0.0.2-beta90 → 0.0.3-beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +2 -12
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,10 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  const path = require('path');
4
- const httpclient = require('urllib');
5
4
  const fs = require('fs');
6
- const { SSL_OP_ALL } = require('constants');
7
5
  const fsPromises = fs.promises;
6
+ const axios = require('axios');
8
7
 
9
8
  const PLUGIN_NAME = 'homebridge-tauron-elicznik';
10
9
  const PLATFORM_NAME = 'tauroneLicznik';
@@ -179,9 +178,6 @@ class eLicznikDevice {
179
178
  this.log.debug('Device: %s %s, requesting Device state.', this.meterId, this.name);
180
179
  try {
181
180
  const url = CHARTS_URL + '?dane[chartYear]=2021&dane[paramType]=year&dane[checkOZE]=on&dane[smartNr]=' + this.meterId;
182
-
183
- const token = Buffer.from(`${this.user}:${this.passwd}`, 'utf8').toString('base64')
184
-
185
181
  const payload = {
186
182
  username: this.user,
187
183
  password: this.passwd,
@@ -190,15 +186,9 @@ class eLicznikDevice {
190
186
  const options = {
191
187
  method: 'POST',
192
188
  data: payload,
193
- httpsAgent: true,
194
- ciphers: 'DEFAULT@SECLEVEL=1',
195
- headers: {
196
- 'Content-Type': 'application/x-www-form-urlencoded'
197
- },
189
+ headers: HEADERS
198
190
  };
199
- const response = httpclient(LOGIN_URL, options);
200
191
 
201
- this.log('33333344', response);
202
192
  const energyImport = 0;
203
193
  const energyExport = 0;
204
194
  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-beta90",
4
+ "version": "0.0.3-beta.0",
5
5
  "description": "Homebridge plugin (https://github.com/homebridge/homebridge) to read data from Tauron eLicznik.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -27,11 +27,11 @@
27
27
  "LICENSE"
28
28
  ],
29
29
  "engines": {
30
- "node": ">=12.0.0",
30
+ "node": ">=14.0.0",
31
31
  "homebridge": ">=1.3.0"
32
32
  },
33
33
  "dependencies": {
34
- "urllib": "^2.37.4"
34
+ "axios": ">=0.25.0"
35
35
  },
36
36
  "keywords": [
37
37
  "homebridge",