Ioniq auxPerc workaround - fix
Signed-off-by: Martin Kolací <martin.kolaci@lmc.eu>
This commit is contained in:
@@ -156,11 +156,20 @@ void CarHyundaiIoniq::parseRowMerged() {
|
||||
liveData->params.batFanStatus = liveData->hexToDecFromResponse(58, 60, 2, true);
|
||||
liveData->params.batFanFeedbackHz = liveData->hexToDecFromResponse(60, 62, 2, true);
|
||||
liveData->params.auxVoltage = liveData->hexToDecFromResponse(62, 64, 2, true) / 10.0;
|
||||
float tmpAuxPerc;
|
||||
if(liveData->params.ignitionOn) {
|
||||
liveData->params.auxPerc = map(liveData->params.auxVoltage, 12.8, 14.8, 0, 100);
|
||||
tmpAuxPerc = map(liveData->params.auxVoltage * 10, 128, 148, 0, 1000) / 10;
|
||||
} else {
|
||||
liveData->params.auxPerc = map(liveData->params.auxVoltage, 11.6, 12.8, 0, 100);
|
||||
tmpAuxPerc = map(liveData->params.auxVoltage * 10, 116, 128, 0, 1000) / 10;
|
||||
}
|
||||
if(tmpAuxPerc > 100) {
|
||||
liveData->params.auxPerc = 100;
|
||||
} else if(tmpAuxPerc < 0) {
|
||||
liveData->params.auxPerc = 0;
|
||||
} else {
|
||||
liveData->params.auxPerc = tmpAuxPerc;
|
||||
}
|
||||
|
||||
liveData->params.batPowerAmp = - liveData->hexToDecFromResponse(24, 28, 2, true) / 10.0;
|
||||
liveData->params.batVoltage = liveData->hexToDecFromResponse(28, 32, 2, false) / 10.0;
|
||||
liveData->params.batPowerKw = (liveData->params.batPowerAmp * liveData->params.batVoltage) / 1000.0;
|
||||
|
||||
Reference in New Issue
Block a user