Returns a snapshot of all available battery information, or null if no battery is present.
null
The returned object contains (values may be null if unavailable on the current hardware):
percentage
isCharging
isCharged
source
"ac"
"battery"
"ups"
"unknown"
health
"Good"
healthCondition
cycleCount
capacity
maxCapacity
designCapacity
voltage
amperage
watts
temperature
timeRemaining
timeToFullCharge
serial
An object with battery fields, or null if no battery is present.
Returns a snapshot of all available battery information, or
nullif no battery is present.The returned object contains (values may be
nullif unavailable on the current hardware):percentage— charge level 0–100isCharging— whether chargingisCharged— whether fully chargedsource—"ac","battery","ups", or"unknown"health— health string, e.g."Good"healthCondition— health condition detail, ornullcycleCount— charge cycle countcapacity— current capacity in mAhmaxCapacity— current maximum capacity in mAhdesignCapacity— original design capacity in mAhvoltage— voltage in millivoltsamperage— current in milliamps (negative when discharging)watts— power in watts (negative when discharging)temperature— temperature in °CtimeRemaining— estimated minutes remaining, ornullif calculatingtimeToFullCharge— estimated minutes to full charge, ornullif not applicableserial— battery serial number