Skip to content

Commit

Permalink
add cupra pos, mileage and climate settings
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Apr 10, 2024
1 parent b52c8ba commit 3688460
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3257,6 +3257,64 @@ class VwWeconnect extends utils.Adapter {
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
});

await axios({
method: "get",
maxBodyLength: Infinity,
url: "https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/" + vin + "/parkingposition",
headers: {
accept: "*/*",
"user-agent": this.userAgent,
"accept-language": "de-de",
authorization: "Bearer " + this.config.atoken,
},
})
.then((res) => {
this.log.debug(JSON.stringify(res.data));
this.json2iob.parse(vin + ".parkingposition", res.data);
})
.catch((error) => {
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
});
await axios({
method: "get",
maxBodyLength: Infinity,
url: "https://ola.prod.code.seat.cloud.vwgroup.com/v1/vehicles/" + vin + "/mileage",
headers: {
accept: "*/*",
"user-agent": this.userAgent,
"accept-language": "de-de",
authorization: "Bearer " + this.config.atoken,
},
})
.then((res) => {
this.log.debug(JSON.stringify(res.data));
this.json2iob.parse(vin + ".mileage", res.data);
})
.catch((error) => {
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
});
await axios({
method: "get",
maxBodyLength: Infinity,
url: "https://ola.prod.code.seat.cloud.vwgroup.com/v2/vehicles/" + vin + "/climatisation/settings",
headers: {
accept: "*/*",
"user-agent": this.userAgent,
"accept-language": "de-de",
authorization: "Bearer " + this.config.atoken,
},
})
.then((res) => {
this.log.debug(JSON.stringify(res.data));
this.json2iob.parse(vin + ".climatisation.settings", res.data);
})
.catch((error) => {
this.log.error(error);
error.response && this.log.error(JSON.stringify(error.response.data));
});
});
}
setSeatCupraStatus(vin, action, state) {
Expand Down

0 comments on commit 3688460

Please sign in to comment.