iobroker.renault 0.0.16 → 0.0.20

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 (3) hide show
  1. package/io-package.json +5 -2
  2. package/main.js +19 -20
  3. package/package.json +10 -9
package/io-package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "renault",
4
- "version": "0.0.16",
4
+ "version": "0.0.20",
5
5
  "news": {
6
- "0.0.16": {
6
+ "0.0.20": {
7
+ "en": "fix login"
8
+ },
9
+ "0.0.17": {
7
10
  "en": "update apikey"
8
11
  },
9
12
  "0.0.15": {
package/main.js CHANGED
@@ -9,7 +9,7 @@
9
9
  const utils = require("@iobroker/adapter-core");
10
10
  const axios = require("axios").default;
11
11
  const qs = require("qs");
12
- const Json2iob = require("./lib/json2iob");
12
+ const Json2iob = require("json2iob");
13
13
 
14
14
  class Renault extends utils.Adapter {
15
15
  /**
@@ -48,24 +48,25 @@ class Renault extends utils.Adapter {
48
48
  //DE API Key
49
49
  this.apiKey = "3_7PLksOyBRkHv126x5WhHb-5pqC1qFR8pQjxSeLB6nhAnPERTUlwnYoznHSxwX668";
50
50
  this.apiKeyUpdate = "YjkKtHmGfaceeuExUDKGxrLZGGvtVS0J";
51
- await this.requestClient({
52
- method: "get",
53
- url: "https://raw.githubusercontent.com/db-EV/ZoePHP/main/src/api-keys.php",
54
- })
55
-
56
- .then((res) => {
57
- this.log.debug(JSON.stringify(res.data));
58
- const data = res.data;
59
- //find kamereon_api via regex
60
- const regex = /\$kamereon_api\s*=\s*['"]([^'"]+)['"]/;
61
- const match = data.match(regex);
62
- if (match && match[1]) {
63
- this.apiKeyUpdate = match[1];
64
- }
51
+ try {
52
+ await this.requestClient({
53
+ method: "get",
54
+ url: "https://raw.githubusercontent.com/hacf-fr/renault-api/main/src/renault_api/const.py",
65
55
  })
66
- .catch((error) => {
67
- this.log.debug(error);
68
- });
56
+
57
+ .then((res) => {
58
+ this.log.debug(JSON.stringify(res.data));
59
+
60
+ if (res.data.split('KAMEREON_APIKEY = "')[2] && res.data.split('KAMEREON_APIKEY = "')[2].split('"')[0]) {
61
+ this.apiKeyUpdate = res.data.split('KAMEREON_APIKEY = "')[2].split('"')[0];
62
+ }
63
+ })
64
+ .catch((error) => {
65
+ this.log.debug(error);
66
+ });
67
+ } catch (error) {
68
+ this.log.debug(error);
69
+ }
69
70
  if (this.config.apiKeyUpdate) {
70
71
  this.apiKeyUpdate = this.config.apiKeyUpdate;
71
72
  }
@@ -102,8 +103,6 @@ class Renault extends utils.Adapter {
102
103
  httpStatusCodes: "false",
103
104
  loginID: this.config.username,
104
105
  password: this.config.password,
105
- sdk: "js_latest",
106
- include: "profile,data",
107
106
  }),
108
107
  })
109
108
  .then((res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.renault",
3
- "version": "0.0.16",
3
+ "version": "0.0.20",
4
4
  "description": "Adapter for Renault and Renault",
5
5
  "author": {
6
6
  "name": "TA2k",
@@ -25,27 +25,28 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@iobroker/adapter-core": "^2.6.8",
28
- "axios": "^1.3.6",
28
+ "axios": "^1.4.0",
29
29
  "json-bigint": "^1.0.0",
30
- "qs": "^6.11.1"
30
+ "json2iob": "^2.4.4",
31
+ "qs": "^6.11.2"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@iobroker/testing": "^4.1.0",
34
- "@types/chai": "^4.3.4",
35
+ "@types/chai": "^4.3.5",
35
36
  "@types/chai-as-promised": "^7.1.5",
36
37
  "@types/mocha": "^10.0.1",
37
- "@types/node": "^18.15.12",
38
+ "@types/node": "^18.16.19",
38
39
  "@types/proxyquire": "^1.3.28",
39
- "@types/sinon": "^10.0.14",
40
+ "@types/sinon": "^10.0.15",
40
41
  "@types/sinon-chai": "^3.2.9",
41
42
  "chai": "^4.3.7",
42
43
  "chai-as-promised": "^7.1.1",
43
- "eslint": "^8.38.0",
44
+ "eslint": "^8.44.0",
44
45
  "mocha": "^10.2.0",
45
46
  "proxyquire": "^2.1.3",
46
- "sinon": "^15.0.3",
47
+ "sinon": "^15.2.0",
47
48
  "sinon-chai": "^3.7.0",
48
- "typescript": "^5.0.4"
49
+ "typescript": "^5.1.6"
49
50
  },
50
51
  "main": "main.js",
51
52
  "files": [