class 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 udi - the UDI of the battery with the new charge percent |
|
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 udi - the UDI of the battery with the new charge state |
|
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 udi - the UDI of the battery with the new plugging state |
|
Retrieves the type of device holding this battery.
Returns the type of device holding this battery See also Solid.Battery.BatteryType |
This enum type defines the type of the device holding the battery
- PdaBattery : A battery in a Personal Digital Assistant - UpsBattery : A battery in an Uninterruptible Power Supply - PrimaryBattery : A primary battery for the system (for example laptop battery) - MouseBattery : A battery in a mouse - KeyboardBattery : A battery in a keyboard - KeyboardMouseBattery : A battery in a combined keyboard and mouse - CameraBattery : A battery in a camera - UnknownBattery : A battery in an unknown device
UnknownBattery | - | - | ||
PdaBattery | - | - | ||
UpsBattery | - | - | ||
PrimaryBattery | - | - | ||
MouseBattery | - | - | ||
KeyboardBattery | - | - | ||
KeyboardMouseBattery | - | - | ||
CameraBattery | - | - |
This enum type defines charge state of a battery
- NoCharge : Battery charge is stable, not charging or discharging or the state is Unknown - Charging : Battery is charging - Discharging : Battery is discharging
NoCharge | - | - | ||
Charging | - | - | ||
Discharging | - | - |