iobroker.renault 0.0.16 → 0.0.17
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 +2 -2
- package/main.js +18 -17
- package/package.json +1 -1
package/io-package.json
CHANGED
package/main.js
CHANGED
|
@@ -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
|
}
|