Hello,
We tried this method to get the battery on a hololens 2 but the values returned are not consistent:
#if WINDOWS_UWP
using Windows.Devices.Power;
#endif
...
#if WINDOWS_UWP
var aggBattery = Battery.AggregateBattery;
var report = aggBattery.GetReport();
Debug.Log("Battery Report: DeviceId - " +aggBattery.DeviceId.ToString());
Debug.Log("Battery Report: Status - " + report.Status.ToString());
Debug.Log("Battery Report: FullCharge - " + report.FullChargeCapacityInMilliwattHours.ToString());
Debug.Log("Battery Report: Remaining - " + report.RemainingCapacityInMilliwattHours.ToString());
Debug.Log("Battery Report: Charge Rate - " + report.ChargeRateInMilliwatts.ToString());
Debug.Log("Battery Report: Design Capacity - " + report.DesignCapacityInMilliwattHours.ToString());
#endif
Battery Report: DeviceId - AggregateBattery
Battery Report: Status - Discharging
Battery Report: FullCharge - 4481
Battery Report: Remaining - 3305
Battery Report: Charge Rate - -6751
Battery Report: Design Capacity - 4400
The headset was ~70% charged, which was correct from the point of view of FullCharge and Remaining, but the drain rate seems far too high. Remaining autonomy would be 0.48 hour with the battery at 70% (when discharging, RemainingCapacityInMilliwattHours / Abs(ChargeRateInMilliwatts) = remainingTimeInHours). The autnotnomie is actually much higher (between 2h and 2h30).
In this post https://forums.hololens.com/discussion/3133/is-there-a-way-to-get-the-battery-level-from-the-hololens-through-unity, the given values were:
Battery Report: DeviceId - AggregateBattery
Battery Report: Status - Discharging
Battery Report: FullCharge - 16710
Battery Report: Remaining - 15664
Battery Report: Charge Rate - -3409
Battery Report: Design Capacity - 16500
Both results are from Hololens 2, but capacities are different. 16500 looks like the capacity in mAh, while 4400 looks like the capacity in mWh (i guess). But Charge rate looks to be still in mAh in both.
Is there a unit issue in the values returned by Battery.GetReport() ?
Regards