chrome.system.powerSource
| Description: |
The chrome.system.powerSource API allows Chrome Kiosk Apps to
query the state of connected power sources.
|
| Availability: |
Since Chrome 69.
|
| Permissions: |
"system.powerSource"
|
Summary
| Types | |
|---|---|
| PowerSourceInfo | |
| Methods | |
getPowerSourceInfo −
chrome.system.powerSource.getPowerSourceInfo(function callback)
| |
requestStatusUpdate −
chrome.system.powerSource.requestStatusUpdate()
| |
| Events | |
| onPowerChanged | |
Types
PowerSourceInfo
| properties | ||
|---|---|---|
enum of "unknown", "mains", or "usb" |
type |
Type of power source.
|
| double | (optional) maxPower |
Maximum power this source is capable of delivering if known. Reported in watts, rounded to two significant digits. |
| boolean | active |
Whether this power source is connected to the device. |
Methods
getPowerSourceInfo
chrome.system.powerSource.getPowerSourceInfo(function callback)
Requests information on attached power sources.
| Parameters | |||||
|---|---|---|---|---|---|
| function | callback |
The callback to invoke with the results or undefined if the power source information is not known. The callback parameter should be a function that looks like this: function(array of PowerSourceInfo powerSourceInfo) {...};
|
|||
requestStatusUpdate
chrome.system.powerSource.requestStatusUpdate()
Requests a power source status update. Resulting power source status updates are observable using onPowerChanged.
Events
onPowerChanged
Event for changes in the set of connected power sources.
addListener
chrome.system.powerSource.onPowerChanged.addListener(function callback)
| Parameters | |||||
|---|---|---|---|---|---|
| function | callback |
The callback parameter should be a function that looks like this: function(array of PowerSourceInfo powerSourceInfo) {...};
|
|||