mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 10:19:29 +02:00
Only display balancing in legend if cells are balancing (and thus battery reports this per cell)
This commit is contained in:
parent
3d2b6c48c0
commit
dfc4e982b0
1 changed files with 23 additions and 6 deletions
|
@ -50,9 +50,17 @@ String cellmonitor_processor(const String& var) {
|
||||||
content +=
|
content +=
|
||||||
"<span style='color: white; background-color: blue; font-weight: bold; padding: 2px 8px; border-radius: 4px; "
|
"<span style='color: white; background-color: blue; font-weight: bold; padding: 2px 8px; border-radius: 4px; "
|
||||||
"margin-right: 15px;'>Idle</span>";
|
"margin-right: 15px;'>Idle</span>";
|
||||||
content +=
|
bool battery_balancing = false;
|
||||||
"<span style='color: black; background-color: #00FFFF; font-weight: bold; padding: 2px 8px; border-radius: "
|
for (uint8_t i = 0u; i < datalayer.battery.info.number_of_cells; i++) {
|
||||||
"4px; margin-right: 15px;'>Balancing</span>";
|
battery_balancing = datalayer.battery.status.cell_balancing_status[i];
|
||||||
|
if (battery_balancing)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (battery_balancing) {
|
||||||
|
content +=
|
||||||
|
"<span style='color: black; background-color: #00FFFF; font-weight: bold; padding: 2px 8px; border-radius: "
|
||||||
|
"4px; margin-right: 15px;'>Balancing</span>";
|
||||||
|
}
|
||||||
content +=
|
content +=
|
||||||
"<span style='color: white; background-color: red; font-weight: bold; padding: 2px 8px; border-radius: "
|
"<span style='color: white; background-color: red; font-weight: bold; padding: 2px 8px; border-radius: "
|
||||||
"4px;'>Min/Max</span>";
|
"4px;'>Min/Max</span>";
|
||||||
|
@ -76,9 +84,18 @@ String cellmonitor_processor(const String& var) {
|
||||||
content +=
|
content +=
|
||||||
"<span style='color: white; background-color: blue; font-weight: bold; padding: 2px 8px; border-radius: 4px; "
|
"<span style='color: white; background-color: blue; font-weight: bold; padding: 2px 8px; border-radius: 4px; "
|
||||||
"margin-right: 15px;'>Idle</span>";
|
"margin-right: 15px;'>Idle</span>";
|
||||||
content +=
|
|
||||||
"<span style='color: black; background-color: #00FFFF; font-weight: bold; padding: 2px 8px; border-radius: "
|
bool battery2_balancing = false;
|
||||||
"4px; margin-right: 15px;'>Balancing</span>";
|
for (uint8_t i = 0u; i < datalayer.battery2.info.number_of_cells; i++) {
|
||||||
|
battery2_balancing = datalayer.battery2.status.cell_balancing_status[i];
|
||||||
|
if (battery2_balancing)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (battery2_balancing) {
|
||||||
|
content +=
|
||||||
|
"<span style='color: black; background-color: #00FFFF; font-weight: bold; padding: 2px 8px; border-radius: "
|
||||||
|
"4px; margin-right: 15px;'>Balancing</span>";
|
||||||
|
}
|
||||||
content +=
|
content +=
|
||||||
"<span style='color: white; background-color: red; font-weight: bold; padding: 2px 8px; border-radius: "
|
"<span style='color: white; background-color: red; font-weight: bold; padding: 2px 8px; border-radius: "
|
||||||
"4px;'>Min/Max</span>";
|
"4px;'>Min/Max</span>";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue