On Tue Feb 28 12:09:51 2023 +0000, Brendan Shanks wrote:
Thanks for this, I hadn't realized `IOPMCopyBatteryInfo` was so deprecated. Looking at [Chromium's use of `IOPSCopyPowerSources`](https://source.chromium.org/chromium/chromium/src/+/main:services/device/bat...), they first check that the source is present and internal, which seems like a good idea.
I changed it so it it does similar checks to Chromium and uses the first power source that works (and removed the internal battery check on kIOPSTypeKey since that is always true in that case already)