ApplesauceOS
Read Markdown ↗Download .md

getBatteryInfo

Read battery status.

js
getBatteryInfo()

Arguments

No arguments.

Returns

{level, percent, charging, state}; level is 0..1, percent 0..100 when available.

Example

js
console.log(JSON.stringify(getBatteryInfo()));

All JavaScript APIs · Automation playbook