feat: add powerMonitor.onBatteryPower (#26494)

This commit is contained in:
Jeremy Rose 2020-11-16 16:31:46 -08:00 committed by GitHub
parent 8594b55dee
commit a9924e1c32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 2 deletions

View file

@ -65,3 +65,18 @@ before considered idle. `locked` is available on supported systems only.
Returns `Integer` - Idle time in seconds
Calculate system idle time in seconds.
### `powerMonitor.isOnBatteryPower()`
Returns `Boolean` - Whether the system is on battery power.
To monitor for changes in this property, use the `on-battery` and `on-ac`
events.
## Properties
### `powerMonitor.onBatteryPower`
A `Boolean` property. True if the system is on battery power.
See [`powerMonitor.isOnBatteryPower()`](#powermonitorisonbatterypower).