diff --git a/main.js b/main.js index 4230cd4..59c5872 100755 --- a/main.js +++ b/main.js @@ -1511,20 +1511,18 @@ class Mercedesme extends utils.Adapter { clearInterval(this.reconnectInterval); }); this.ws.on("error", (data) => { - this.log.error("WS error:" + data); - this.setState("info.connection", false, true); try { if (data.message.indexOf("428") !== -1) { this.log.warn("Too many requests. Your IP is maybe blocked"); - } - if (data.message.indexOf("429") !== -1) { - this.log.warn("Too many requests. Please reduce reconnect"); - } - if (data.message.indexOf("403") !== -1) { + } else if (data.message.indexOf("429") !== -1) { + this.log.info("429 Too many requests. The account is blocked until 0:00"); + } else if (data.message.indexOf("403") !== -1) { this.refreshToken(true).catch(() => { this.log.error("Refresh Token Failed "); }); + } else { + this.log.error("WS error:" + data); } } catch (error) { this.log.error(error); @@ -1554,7 +1552,7 @@ class Mercedesme extends utils.Adapter { setTimeout(() => { this.connectWS(); }, 2000); - }, 1 * 60 * 1000); //1min + }, 2 * 60 * 1000); //2min try { const message = VehicleEvents.PushMessage.deserializeBinary(data).toObject(); if (message.debugmessage) { diff --git a/package-lock.json b/package-lock.json index e42832a..2754320 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@iobroker/adapter-core": "^3.2.2", - "axios": "^1.7.7", + "axios": "^1.7.8", "google-protobuf": "^3.21.4", "json2iob": "^2.6.12", "request": "^2.88.2", @@ -26,10 +26,10 @@ "@eslint/js": "^9.15.0", "@iobroker/testing": "^5.0.0", "@tsconfig/node16": "^16.1.3", - "@types/node": "^22.9.0", + "@types/node": "^22.10.0", "eslint": "^9.15.0", "globals": "^15.12.0", - "typescript": "~5.6.3" + "typescript": "~5.7.2" }, "engines": { "node": ">=16" @@ -566,12 +566,12 @@ "dev": true }, "node_modules/@types/node": { - "version": "22.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz", - "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==", + "version": "22.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", + "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", "dev": true, "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/acorn": { @@ -718,9 +718,9 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -2693,9 +2693,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2706,9 +2706,9 @@ } }, "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "node_modules/universalify": { @@ -3303,12 +3303,12 @@ "dev": true }, "@types/node": { - "version": "22.9.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.0.tgz", - "integrity": "sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ==", + "version": "22.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.0.tgz", + "integrity": "sha512-XC70cRZVElFHfIUB40FgZOBbgJYFKKMa5nb9lxcwYstFG/Mi+/Y0bGS+rs6Dmhmkpq4pnNiLiuZAbc02YCOnmA==", "dev": true, "requires": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "acorn": { @@ -3416,9 +3416,9 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.7.8", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.8.tgz", + "integrity": "sha512-Uu0wb7KNqK2t5K+YQyVCLM76prD5sRFjKHbJYCP1J7JFGEQ6nN7HWn9+04LAeiJ3ji54lgS/gZCH1oxyrf1SPw==", "requires": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -4884,15 +4884,15 @@ "dev": true }, "typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "dev": true }, "undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "version": "6.20.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", "dev": true }, "universalify": { diff --git a/package.json b/package.json index 5bee8d1..d9da008 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "bundleDependencies": [], "dependencies": { "@iobroker/adapter-core": "^3.2.2", - "axios": "^1.7.7", + "axios": "^1.7.8", "google-protobuf": "^3.21.4", "json2iob": "^2.6.12", "request": "^2.88.2", @@ -27,10 +27,10 @@ "@eslint/js": "^9.15.0", "@iobroker/testing": "^5.0.0", "@tsconfig/node16": "^16.1.3", - "@types/node": "^22.9.0", + "@types/node": "^22.10.0", "eslint": "^9.15.0", "globals": "^15.12.0", - "typescript": "~5.6.3" + "typescript": "~5.7.2" }, "engines": { "node": ">=16"