Add detection for 102s to 70kWh

This commit is contained in:
Daniel Öster 2025-04-21 10:58:58 +03:00
parent ef6d823e98
commit cf71ec9de2

View file

@ -236,6 +236,12 @@ void update_values_battery() { //This function maps all the values fetched via
datalayer.battery.status.current_dA;
if (poll_amount_cells == 102) { // We have determined that we are on 70kWh pack
datalayer.battery.info.total_capacity_Wh = 70000;
datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_70_DV;
datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_70_DV;
}
//Calculate the remaining Wh amount from SOC% and max Wh value.
datalayer.battery.status.remaining_capacity_Wh = static_cast<uint32_t>(
(static_cast<double>(datalayer.battery.status.real_soc) / 10000) * datalayer.battery.info.total_capacity_Wh);