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.