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.
- package/io-package.json +5 -2
- package/main.js +19 -20
- package/package.json +10 -9
package/io-package.json
CHANGED
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("
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
67
|
-
|
|
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.
|
|
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.
|
|
28
|
+
"axios": "^1.4.0",
|
|
29
29
|
"json-bigint": "^1.0.0",
|
|
30
|
-
"
|
|
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.
|
|
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.
|
|
38
|
+
"@types/node": "^18.16.19",
|
|
38
39
|
"@types/proxyquire": "^1.3.28",
|
|
39
|
-
"@types/sinon": "^10.0.
|
|
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.
|
|
44
|
+
"eslint": "^8.44.0",
|
|
44
45
|
"mocha": "^10.2.0",
|
|
45
46
|
"proxyquire": "^2.1.3",
|
|
46
|
-
"sinon": "^15.0
|
|
47
|
+
"sinon": "^15.2.0",
|
|
47
48
|
"sinon-chai": "^3.7.0",
|
|
48
|
-
"typescript": "^5.
|
|
49
|
+
"typescript": "^5.1.6"
|
|
49
50
|
},
|
|
50
51
|
"main": "main.js",
|
|
51
52
|
"files": [
|