class Solid.Battery |
|
|
This device interface is available on batteries. |
|
Creates a new Battery object. You generally won't need this. It's created when necessary using Device.as().
backendObject - the device interface object provided by the backend See also Solid.Device.as() |
|
Retrieves the current charge level of the battery normalised to percent. Returns the current charge level normalised to percent |
|
This signal is emitted when the charge percent value of this battery has changed.
value - the new charge percent value of the battery |
|
Retrieves the current charge state of the battery. It can be in a stable state (no charge), charging or discharging. Returns the current battery charge state See also Solid.Battery.ChargeState |
|
This signal is emitted when the charge state of this battery has changed.
newState - the new charge state of the battery, it's one of the type Solid.Battery.ChargeState See also Solid.Battery.ChargeState |
|
Get the Solid.DeviceInterface.Type of the Battery device interface. Returns the Battery device interface type See also Solid.DeviceInterface.Type |
|
Indicates if this battery is plugged. Returns true if the battery is plugged, false otherwise |
|
Indicates if the battery is rechargeable. Returns true if the battery is rechargeable, false otherwise (one time usage) |
|
This signal is emitted if the battery get plugged in/out of the battery bay.
newState - the new plugging state of the battery, type is boolean |
|
Retrieves the type of device holding this battery. Returns the type of device holding this battery See also Solid.Battery.BatteryType |
UnknownBattery | - | ||
PdaBattery | - | ||
UpsBattery | - | ||
PrimaryBattery | - | ||
MouseBattery | - | ||
KeyboardBattery | - | ||
KeyboardMouseBattery | - | ||
CameraBattery | - |
NoCharge | - | ||
Charging | - | ||
Discharging | - |