Closed diegoroversi closed 9 months ago
Why the last change that prevents acpiACName if "/capacity" exists?
Please always surround assignment symbols with a space on either side.
Fix your language errors: "percentual" -> percentage, not "does'nt".
The test for if (BATcapacity_full == -1) {
is actually bogus since at that point BATcapacity_full always has the initialized value of -1.
Thanks for the review.
The last change is needed for another bug. The old code assume that any power_supply that contains a online file is an AC. But it's not true, battery can have it also, so the code can select a battery as AC, if the power_supply are in the "wrong" order.
I added a check that "capacity" file is not present to be sure is really an AC.
I fixed the other issues and tested on a couple of laptop, to be sure there are no regression.
@diegoroversi If you like, you can review/test my commit. It reduces the amount of code spent on opening and reading files and improves readability.
@diegoroversi If you like, you can review/test my commit. It reduces the amount of code spent on opening and reading files and improves readability.
The changes look fine to me, and I see no regression after testing on two laptop.
Thanks!
Some battery have no information about full charge.
This fix it's just use "capacity" which is expressed as a percentage, just in this case.