#cp.battery
Provides access to various properties of the battery. Each of these properties is a cp.prop
, so it can be watched for changes. For example:
This will print
"Now using AC Power" or "Now using Battery Power" whenever the power supply changes.
By default the watcher initialises in a "stopped" state, and must be started for the cp.prop
watchers to trigger.
#API Overview
Constants - Useful values which cannot be changed
- amperage
- capacity
- cycles
- designCapacity
- health
- healthCondition
- isCharged
- isCharging
- isFinishingCharge
- maxCapacity
- otherBatteryInfo
- percentage
- psuSerial
- timeRemaining
- timeToFullCharge
- voltage
- watts
Variables - Configurable values
Functions - API calls offered directly by the extension