Skip to content

Commit

Permalink
add wakeup and window heating feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Dec 2, 2023
1 parent 1280ee8 commit 543517e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,28 @@ class VwWeconnect extends utils.Adapter {
},
native: {},
});
this.extendObject(vin + ".remote.refresh", {
type: "state",
common: {
name: "Refresh Data",
type: "boolean",
role: "boolean",
def: false,
write: true,
},
native: {},
});
this.extendObject(vin + ".remote.vehiclewakeuptrigger", {
type: "state",
common: {
name: "Wake up car and refresh data only every 15min allowed",
type: "boolean",
role: "boolean",
def: false,
write: true,
},
native: {},
});
this.extendObject(vin + ".remote.honkandflash", {
type: "state",
common: {
Expand Down Expand Up @@ -4991,6 +5013,10 @@ class VwWeconnect extends utils.Adapter {
this.updateStatus();
return;
}
if (id.indexOf("remote.refresh") !== -1) {
this.updateStatus();
return;
}
if (id.indexOf("remote.forceRefresh") !== -1) {
this.requestStatusUpdate(vin);
return;
Expand Down Expand Up @@ -5548,6 +5574,14 @@ class VwWeconnect extends utils.Adapter {
return;
}
}
if (action === "vehiclewakeuptrigger") {
if (this.config.type === "id" || this.config.type === "audietron") {
this.setIdRemote(vin, action).catch(() => {
this.log.error("failed set state " + action);
});
return;
}
}
if (action === "flash") {
//HONK_AND_FLASH
const idArray = id.split(".");
Expand Down Expand Up @@ -5740,6 +5774,9 @@ class VwWeconnect extends utils.Adapter {
if (id.endsWith(".parkingposition.lon")) {
this.setLongitude(vin, state.val);
}
if (id.indexOf(".windowHeatingStatus") !== -1) {
this.setState(vin + ".remote.windowheating", state.val.toLocaleLowerCase() === "off" ? false : true, true);
}
}
} else {
// The state was deleted
Expand Down

0 comments on commit 543517e

Please sign in to comment.