mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 02:09:30 +02:00
Refactor: Code cleanup and optimization
This commit is contained in:
parent
2a4dcb3d63
commit
9d2a3be708
19 changed files with 27 additions and 79 deletions
|
@ -117,7 +117,7 @@ static void publish_common_info(void) {
|
|||
doc["pause_status"] = get_emulator_pause_status();
|
||||
|
||||
//only publish these values if BMS is active and we are comunication with the battery (can send CAN messages to the battery)
|
||||
if (datalayer.battery.status.bms_status == ACTIVE && can_send_CAN) {
|
||||
if (datalayer.battery.status.bms_status == ACTIVE && can_send_CAN && millis() > BOOTUP_TIME) {
|
||||
doc["SOC"] = ((float)datalayer.battery.status.reported_soc) / 100.0;
|
||||
doc["SOC_real"] = ((float)datalayer.battery.status.real_soc) / 100.0;
|
||||
doc["state_of_health"] = ((float)datalayer.battery.status.soh_pptt) / 100.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue