c--- / applesmc-next

Patches to Linux kernel to allow setting battery charge thresholds on Apple devices.
GNU General Public License v2.0
26 stars 0 forks source link

Information about Charging LED (full threshold) #5

Open maniacx opened 1 year ago

maniacx commented 1 year ago

Hello @c---

I developed a Gnome extension called Battery Health Charging a while ago for several laptop brands/models which also included Apple Intel laptops using your kernel module applesmc-next.

However lately I revisited your page and noticed a note:

Note that for charge_control_full_threshold to work it needs to be set to a value less than than the end threshold because the battery will tend to float slightly under the maximum. Subtract at least 2% or more from the end threshold

I may have missed the LED info earlier, but I am assuming that it probably ligths green when battery level has reached to a threshold value.

  1. I would like to know what is the reason to have LED status user configurable? Why haven't you hardcode automatically set LED status to charge_control_end_threshold - 2 instead of giving users option to manually set it?

  2. Is there a reason that users may not want to set it to charge_control_end_threshold - 2 ?

I don't have a mac, so I just want to get clear information of what LED does and how the charge_control_full_threshold works and why is it needed.

I did add the function to my extension to set the LED sysfs path value charge_control_full_threshold to charge_control_end_threshold - 2 using this commit https://github.com/maniacx/Battery-Health-Charging/commit/f844c38055e9c083faa2564840ba13fe7a687030

But then, I thought of getting a second opinion from you, if I should include or revert this.

c--- commented 1 year ago

Yes, that option makes the LED on the charge plug turn green when it's "fully charged". The option for the user to change that is just because the SMC allows it.

I don't know if most people want it to turn green when it's not really fully charged. For example I don't change the full threshold because by never turning green it reminds me the laptop is only partially charged in case I need to switch to full charge mode before taking it off the charger. However, a lot of other brand laptops do show a full charge even when they're not really.

I can't say for sure which is better, that's just how I use it. This is why I left it up to the user preference.

maniacx commented 1 year ago

Last question.

If the user doesn't never changed the value of charge_control_full_threshold , by default what is the value of charge_control_full_threshold? 100 or 98?

Also if user has changed charge_control_full_threshold to 60 and decides, they want change it back to original behavior, what should they set it to? 100 or 98?

c--- commented 1 year ago

95% is the default on my 2015 Air after resetting the SMC.

maniacx commented 1 year ago

Thank you for all the information. I have included an option in extension preferences to enable / disable charging leds behavior.

On enabling this setting

if charge_control_end_threshold >= 97 then charge_control_full_threshold = 95

if charge_control_end_threshold < 97 then charge_control_full_threshold = charge_control_end_threshold - 2

On disabling this setting charge_control_full_threshold = 95 command will be set once (to restore default behavior) and not be used again

settings

quick settings

Thank you Chris