fix: Calculate battery health the right way around
I even did this originally, then got confused when my battery in particular showed 102% and, instead of checking the values I calculate with, just decided to do the stupid thing and do maths the wrong around
This commit is contained in:
parent
805faa47e6
commit
24690248db
|
@ -370,7 +370,7 @@ const std::tuple<uint8_t, float, std::string, float, uint16_t, float> waybar::mo
|
||||||
}
|
}
|
||||||
|
|
||||||
if (charge_full_exists && charge_full_design_exists) {
|
if (charge_full_exists && charge_full_design_exists) {
|
||||||
float bat_health_percent = ((float)charge_full_design / charge_full) * 100;
|
float bat_health_percent = ((float)charge_full / charge_full_design) * 100;
|
||||||
if (main_bat_health_percent == 0.0f || bat_health_percent < main_bat_health_percent) {
|
if (main_bat_health_percent == 0.0f || bat_health_percent < main_bat_health_percent) {
|
||||||
main_bat_health_percent = bat_health_percent;
|
main_bat_health_percent = bat_health_percent;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue