Battery Full Charge Capacity

Not applicable

Man, do I love the new extension attributes. Here's a script I whipped up today to get the Full Charge Capacity from a battery and put it in using an Extension Attribute.

I keep track of the Full Charge Capacity, as it's something Apple wants to know when I call in a battery that has died.

#!/bin/sh

echo "<result>$(system_profiler SPPowerDataType | grep "Full charge" | awk '{ print $5 }')</result>"

It's a pretty easy script, but I figured I'd throw it out here on the list so that anyone that wanted to use it wouldn't have to reinvent the wheel.

I'd be interested in knowing what other Extension Attributes people are using that they find helpful as we go along.

Thanks,
Robert

2 REPLIES 2

cdemarco
New Contributor

Thanks for this!

merps
Contributor III

Very cool. On 10.10.5, I had to change the grep syntax to "Full Charge" - notice the capital C.

#!/bin/sh

echo "<result>$(system_profiler SPPowerDataType | grep "Full Charge" | awk '{ print $5 }')</result>"