style: Refactor battery cycle count choosing
parent
43511992d9
commit
7f1e623f77
|
@ -361,10 +361,13 @@ const std::tuple<uint8_t, float, std::string, float, uint16_t> waybar::modules::
|
||||||
if (fs::exists(bat / "cycle_count")) {
|
if (fs::exists(bat / "cycle_count")) {
|
||||||
std::ifstream(bat / "cycle_count") >> cycle_count;
|
std::ifstream(bat / "cycle_count") >> cycle_count;
|
||||||
}
|
}
|
||||||
if (is_main_battery && (cycle_count > main_bat_cycle_count)) {
|
if (is_main_battery) {
|
||||||
largest_design_capacity = charge_full_design;
|
largest_design_capacity = charge_full_design;
|
||||||
|
|
||||||
|
if (cycle_count > main_bat_cycle_count) {
|
||||||
main_bat_cycle_count = cycle_count;
|
main_bat_cycle_count = cycle_count;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!voltage_now_exists) {
|
if (!voltage_now_exists) {
|
||||||
if (power_now_exists && current_now_exists && current_now != 0) {
|
if (power_now_exists && current_now_exists && current_now != 0) {
|
||||||
|
|
Loading…
Reference in New Issue