Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix battery charging symbol #582

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

ste-fan
Copy link
Contributor

@ste-fan ste-fan commented Aug 16, 2019

Return code of _lp_battery when charging was [1, 2], now it is the
desired [2, 3].

*1 => discharging above threshold
*2 => charging under threshold
*3 => charging above threshold

Return code of `_lp_battery` when charging was [1, 2], now it is the
desired [2, 3].

 *1 => discharging above threshold
 *2 => charging under threshold
 *3 => charging above threshold
When charging thresholds for battery health are set (e.g. on ThinkPads,
the default is never to charge when battery level is at least 96%) it is
common for the battery to be neither charging nor discharging, while not
having 100% charge. Which lead to the green charging symbol being always
displayed.

Example output, in given ThinkPad scenario:
```
$ sudo tlp-stat --battery
--- TLP 1.2.2 --------------------------------------------

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = inactive (no kernel support)
tpacpi-bat = active (thresholds, recalibrate)
tp-smapi   = inactive (ThinkPad not supported)

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SMP
/sys/class/power_supply/BAT0/model_name                     = LNV-45N1
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  56250 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  43670 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  43610 [mWh]
/sys/class/power_supply/BAT0/power_now                      =      0 [mW]
/sys/class/power_supply/BAT0/status                         = Not charging (threshold effective)

tpacpi-bat.BAT0.startThreshold                              =     96 [%]
tpacpi-bat.BAT0.stopThreshold                               =    100 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

Charge                                                      =   99.9 [%]
Capacity                                                    =   77.6 [%]

$ acpi
Battery 0: Not charging, 99%
```
@ste-fan
Copy link
Contributor Author

ste-fan commented Aug 20, 2019

As suggested in #583 I added this commit to make one pull request concerning the battery charging symbol:

Hide battery symbol when not charging

When charging thresholds for battery health are set (e.g. on ThinkPads,
the default is never to charge when battery level is at least 96%) it is
common for the battery to be neither charging nor discharging, while not
having 100% charge. Which lead to the green charging symbol being always
displayed.

Example output, in given ThinkPad scenario:

$ sudo tlp-stat --battery
--- TLP 1.2.2 --------------------------------------------

+++ Battery Features: Charge Thresholds and Recalibrate
natacpi    = inactive (no kernel support)
tpacpi-bat = active (thresholds, recalibrate)
tp-smapi   = inactive (ThinkPad not supported)

+++ ThinkPad Battery Status: BAT0 (Main / Internal)
/sys/class/power_supply/BAT0/manufacturer                   = SMP
/sys/class/power_supply/BAT0/model_name                     = LNV-45N1
/sys/class/power_supply/BAT0/cycle_count                    = (not supported)
/sys/class/power_supply/BAT0/energy_full_design             =  56250 [mWh]
/sys/class/power_supply/BAT0/energy_full                    =  43670 [mWh]
/sys/class/power_supply/BAT0/energy_now                     =  43610 [mWh]
/sys/class/power_supply/BAT0/power_now                      =      0 [mW]
/sys/class/power_supply/BAT0/status                         = Not charging (threshold effective)

tpacpi-bat.BAT0.startThreshold                              =     96 [%]
tpacpi-bat.BAT0.stopThreshold                               =    100 [%]
tpacpi-bat.BAT0.forceDischarge                              =      0

Charge                                                      =   99.9 [%]
Capacity                                                    =   77.6 [%]

$ acpi
Battery 0: Not charging, 99%

@dolmen dolmen merged commit 5f4aeec into liquidprompt:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants