The current code for battery calculation seems to assume that the capacity value returns the non-design battery capacity. This is not the case, and it instead returns the design capacity of the battery.
Currently, the capacity value is used above all other methods if it is present in the /sys directory of the battery. This means that the design capacity of the battery will always be displayed regardless of the design-capacity configuration option.
To remedy this issue, I have restructured the code so that the capacity value is only used if the other possible options for calculation have been exhausted beforehand.
This screenshot shows two instances Waybar while the battery is plugged in at full capacity. The top instance is the current release version, and the bottom instance is the code present in this pull request:
This pull request maintains the functionality of the design-capacity configuration option. Here is the previous screenshot taken again with design-capacity set to true:
Please correct me if I have done anything incorrectly in this pull request, as I am not very familiar with the codebase.
Closes #3293
The current code for battery calculation seems to assume that the
capacity
value returns the non-design battery capacity. This is not the case, and it instead returns the design capacity of the battery.Currently, the
capacity
value is used above all other methods if it is present in the /sys directory of the battery. This means that the design capacity of the battery will always be displayed regardless of thedesign-capacity
configuration option.To remedy this issue, I have restructured the code so that the
capacity
value is only used if the other possible options for calculation have been exhausted beforehand.This screenshot shows two instances Waybar while the battery is plugged in at full capacity. The top instance is the current release version, and the bottom instance is the code present in this pull request:
This pull request maintains the functionality of the
design-capacity
configuration option. Here is the previous screenshot taken again withdesign-capacity
set totrue
:Please correct me if I have done anything incorrectly in this pull request, as I am not very familiar with the codebase.