Skip to content

Commit

Permalink
update skoda user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Mar 10, 2024
1 parent 7bcfcdf commit 9fe8dee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class VwWeconnect extends utils.Adapter {
this.json2iob = new Json2iob(this);
this.jar = request.jar();
this.userAgent = "iobroker v";
this.skodaUserAgent = "OneConnect/000000164 CFNetwork/1494.0.7 Darwin/23.4.0";
this.refreshTokenInterval = null;
this.vwrefreshTokenInterval = null;
this.updateInterval = null;
Expand Down Expand Up @@ -1162,6 +1163,7 @@ class VwWeconnect extends utils.Adapter {
// const jwtauth_code = hashArray[1].substring(hashArray[1].indexOf("=") + 1);
// const jwtaccess_token = hashArray[2].substring(hashArray[2].indexOf("=") + 1);
// const jwtid_token = hashArray[5].substring(hashArray[5].indexOf("=") + 1);

let method = "POST";
let body = "auth_code=" + jwtauth_code + "&id_token=" + jwtid_token;
let url = "https://tokenrefreshservice.apps.emea.vwapps.io/exchangeAuthCode";
Expand Down Expand Up @@ -1200,7 +1202,7 @@ class VwWeconnect extends utils.Adapter {
accept: "*/*",
// authorization: "Bearer " + parsedParameters.id_token,
"content-type": "application/json",
"user-agent": this.useragent,
"user-agent": this.skodaUserAgent,
"accept-language": "de-de",
};
}
Expand Down Expand Up @@ -1855,7 +1857,7 @@ class VwWeconnect extends utils.Adapter {
headers = {
accept: "application/json",
"content-type": "application/json;charset=utf-8",
"user-agent": this.userAgent,
"user-agent": this.skodaUserAgent,
"accept-language": "de-de",
authorization: "Bearer " + this.config.atoken,
};
Expand Down Expand Up @@ -3358,7 +3360,7 @@ class VwWeconnect extends utils.Adapter {
"api-key": "ok",
accept: "application/json",
"content-type": "application/json;charset=utf-8",
"user-agent": this.userAgent,
"user-agent": this.skodaUserAgent,
"accept-language": "de-de",
"If-None-Match": this.etags[url] || "",
authorization: "Bearer " + this.config.atoken,
Expand Down Expand Up @@ -3476,7 +3478,7 @@ class VwWeconnect extends utils.Adapter {
"api-key": "ok",
accept: "application/json",
"content-type": "application/json;charset=utf-8",
"user-agent": this.userAgent,
"user-agent": this.skodaUserAgent,
"accept-language": "de-de",
authorization: "Bearer " + this.config.atoken,
},
Expand Down

0 comments on commit 9fe8dee

Please sign in to comment.