Skip to content

Commit

Permalink
extend initial charging sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Nov 21, 2024
1 parent 9f710d3 commit c2a43d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ class Bmw extends utils.Adapter {
channelName: vehicleName,
});

await this.updateChargingSessionv2(vehicle.vin);
await this.updateChargingSessionv2(vehicle.vin, 200);
}
})
.catch((error) => {
Expand Down Expand Up @@ -674,7 +674,7 @@ class Bmw extends utils.Adapter {
sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async updateChargingSessionv2(vin) {
async updateChargingSessionv2(vin, maxResults = 40) {
if (this.nonChargingHistory[vin]) {
return;
}
Expand Down Expand Up @@ -708,7 +708,9 @@ class Bmw extends utils.Adapter {
vin +
'&next_token&date=' +
dateFormatted +
'-01T00%3A00%3A00.000Z&maxResults=40&include_date_picker=true',
'-01T00%3A00%3A00.000Z&maxResults=' +
maxResults +
'&include_date_picker=true',
path: '.chargingSessions.',
name: 'chargingSessions',
});
Expand Down

0 comments on commit c2a43d3

Please sign in to comment.