I have a question around battery data in macOS, is...
# macos
t
I have a question around battery data in macOS, is there any plans on updating the current osquery table for some of the newer data? IIRC this is not an open API but this screen shot of data would be useful for a few of our use cases
f
what do you see if you run ?
Copy code
osquery> select percent_remaining AS "battery_charge_%", max_capacity, current_capacity from battery;
+------------------+--------------+------------------+
| battery_charge_% | max_capacity | current_capacity |
+------------------+--------------+------------------+
| 100              | 8331         | 8091             |
+------------------+--------------+------------------+
i may have misunderstood your question, are you asking if there is any way to get the usage breakdowns as in your pic? if so I don't believe so.
t
just a more updated set of data that aligns with the new things macOS has added. I think the source code for the battery health part is just < or > 1000 cycles which I think is no longer what Apple even recommends for battery health
s
This is all coming out of some apple IO frameworks. Battery health is straight from that API. Nose around https://github.com/osquery/osquery/blob/e09c4618e70bebe235f59f30c16ae30cca498d15/osquery/tables/system/darwin/battery.mm#L90-L98