Fix lastChargingOnTime
Signed-off-by: Martin Kolací <martin.kolaci@lmc.eu>
This commit is contained in:
@@ -1499,8 +1499,8 @@ void Board320_240::mainLoop() {
|
||||
setBrightness((liveData->settings.lcdBrightness == 0) ? 100 : liveData->settings.lcdBrightness);
|
||||
}
|
||||
|
||||
// Go to sleep when car is off for more than 10s and not charging
|
||||
if (liveData->params.currentTime - liveData->params.lastIgnitionOnTime > 10 && liveData->params.currentTime - liveData->params.lastIgnitionOnTime < MONTH_SEC
|
||||
// Go to sleep when car is off for more than 30s and not charging (AC charger is disabled for few seconds when ignition is turned off)
|
||||
if (liveData->params.currentTime - liveData->params.lastIgnitionOnTime > 30 && liveData->params.currentTime - liveData->params.lastIgnitionOnTime < MONTH_SEC
|
||||
&& !liveData->params.chargingOn
|
||||
&& liveData->params.lastIgnitionOnTime != 0
|
||||
&& liveData->settings.sleepModeEnabled)
|
||||
|
||||
@@ -185,6 +185,9 @@ void CarHyundaiIoniq::parseRowMerged() {
|
||||
|
||||
tempByte = liveData->hexToDecFromResponse(22, 24, 1, false);
|
||||
liveData->params.chargingOn = (bitRead(tempByte, 5) == 1 || bitRead(tempByte, 6) == 1); // bit 5 = AC; bit 6 = DC
|
||||
if(liveData->params.chargingOn) {
|
||||
liveData->params.lastChargingOnTime = liveData->params.currentTime;
|
||||
}
|
||||
|
||||
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
|
||||
liveData->params.batInletC = liveData->hexToDecFromResponse(48, 50, 1, true);
|
||||
|
||||
@@ -237,6 +237,9 @@ void CarKiaEniro::parseRowMerged() {
|
||||
// liveData->params.chargingOn = (bitRead(tempByte, 2) == 1);
|
||||
tempByte = liveData->hexToDecFromResponse(24, 26, 1, false);
|
||||
liveData->params.chargingOn = (bitRead(tempByte, 5) == 1 || bitRead(tempByte, 6) == 1); // bit 5 = AC; bit 6 = DC
|
||||
if(liveData->params.chargingOn) {
|
||||
liveData->params.lastChargingOnTime = liveData->params.currentTime;
|
||||
}
|
||||
|
||||
// This is more accurate than min/max from BMS. It's required to detect kona/eniro cold gates (min 15C is needed > 43kW charging, min 25C is needed > 58kW charging)
|
||||
liveData->params.batMinC = liveData->params.batMaxC = liveData->params.batModuleTempC[0];
|
||||
|
||||
Reference in New Issue
Block a user