freesmartphone.org PowerSupply Interface
Description
This interface provides access to a power supply device.
Namespace
org.freesmartphone.Device.PowerSupply
Methods
Signals
Properties
None
Errors
None
Methods
GetCapacity ( ) → i
Description: Retrieve the capacity of this power supply.
Implementation Note
A wall power supply will always return 100.
Returns:
i: energy The capacity in percent (0-100).
GetPowerStatus ( ) → s
Description: Retrieve the power status for this power supply.
Implementation Note
A wall power supply will always return “full”.
Returns:
s: status The power status. Expected values for a battery are:
- “charging”
- “discharging”
- “full”
- “empty”
- “critical”
- “removed”
- “unknown”
- “online”
- “offline”
- “ac”
Signals
PowerStatus ( s )
Description: Sent, when the power status changes significantly.
Parameters:
s: status The power status. See GetPowerStatus for a list of expected values.
Capacity ( i )
Description: Sent, when the capacity changes.
Parameters:
i: energy The capacity in percent (0-100).