Commit 1ad15a7c changed how the battery percentage is calculated, and the result is wrong for me. Here's the BatteryStatusRecordsRequest data for one of my requests:
The original, correct calculation is (140/240)100, or 58%. The updated algorithm calculates (140/12)100=1166% and the code clamps it to 100%.
Switching the code back to parseInt((status.BatteryStatusRecords.BatteryStatus.BatteryRemainingAmount / status.BatteryStatusRecords.BatteryStatus.BatteryCapacity) * 100) is the right thing to do, I think.
Commit 1ad15a7c changed how the battery percentage is calculated, and the result is wrong for me. Here's the
BatteryStatusRecordsRequest
data for one of my requests:The original, correct calculation is (140/240)100, or 58%. The updated algorithm calculates (140/12)100=1166% and the code clamps it to 100%.
Switching the code back to
parseInt((status.BatteryStatusRecords.BatteryStatus.BatteryRemainingAmount / status.BatteryStatusRecords.BatteryStatus.BatteryCapacity) * 100)
is the right thing to do, I think.