mhaeuser / Battery-Toolkit

Control the platform power state of your Apple Silicon Mac.
BSD 3-Clause "New" or "Revised" License
531 stars 13 forks source link

A few questions about BT functioning #46

Closed Sangeppato closed 1 month ago

Sangeppato commented 1 month ago

First of all, thank you for this amazing application.

I have a few questions regarding its functioning, just for the sake of my curiosity (I hope not to annoy you with them).

It is my understanding that: • Every time the battery charge percentage changes, an event is generated and BT will check whether it has to enable/disable charging according to it. • If the laptop is plugged in, this also works then the laptop's lid is closed and there are no external displays connected, since the computer is not actually sleeping as long as it's connected to power (is this true?). • Such event monitoring is paused when the laptop is running on battery, and the only monitoring that occurs in this case is whether the power adapter gets connected (so the power usage of BT should be minimal).

Is all this correct? Thank you again

mhaeuser commented 1 month ago
  1. Yes.
  2. Not quite. Sleep is explicitly disabled by BT in case the laptop is charging. Once it disables charging, sleep is re-enabled.
  3. Yes. Plugging-in also is event-based, so it will just idle, really.
Sangeppato commented 1 month ago

Thank you. Regarding 2., what happens if the charger is plugged in while the laptop is already sleeping? Will it charge to 100% regardless of the limit?

mhaeuser commented 1 month ago

Basically the laptop virtually always briefly wakes and sleep is successfully disabled in time. There is no guarantee this works, but I’ve never witnessed it fail myself and there’s no better solution sleep-wise. I planned to look into utilizing hardware thresholds some day, but there are some culprits with that as well.

Sangeppato commented 1 month ago

Understood, thank you!