From c2a43d362603961e58cb8c229a7fe4833ffd41d7 Mon Sep 17 00:00:00 2001 From: TA2k Date: Thu, 21 Nov 2024 10:38:54 +0100 Subject: [PATCH] extend initial charging sessions --- main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 9e80c2c..8f97a00 100644 --- a/main.js +++ b/main.js @@ -485,7 +485,7 @@ class Bmw extends utils.Adapter { channelName: vehicleName, }); - await this.updateChargingSessionv2(vehicle.vin); + await this.updateChargingSessionv2(vehicle.vin, 200); } }) .catch((error) => { @@ -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; } @@ -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', });