UPowerGlib.Device¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
||
priv |
r |
Class Details¶
- class UPowerGlib.Device(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod kind_from_string(type)¶
- Parameters:
type (
str
) –- Returns:
enumerated value
- Return type:
Converts a string to a
UPowerGlib.DeviceKind
.New in version 0.9.0.
- classmethod kind_to_string(type_enum)¶
- Parameters:
type_enum (
UPowerGlib.DeviceKind
) –- Returns:
identifier string
- Return type:
Converts a
UPowerGlib.DeviceKind
to a string.New in version 0.9.0.
- classmethod level_from_string(level)¶
- Parameters:
level (
str
) –- Returns:
enumerated value
- Return type:
Converts a string to a
UPowerGlib.DeviceLevel
.New in version 1.0.
- classmethod level_to_string(level_enum)¶
- Parameters:
level_enum (
UPowerGlib.DeviceLevel
) –- Returns:
identifier string
- Return type:
Converts a
UPowerGlib.DeviceLevel
to a string.New in version 1.0.
- classmethod new()¶
- Returns:
a new
UPowerGlib.Device
object.- Return type:
Creates a new
UPowerGlib.Device
object.New in version 0.9.0.
- classmethod state_from_string(state)¶
- Parameters:
state (
str
) –- Returns:
enumerated value
- Return type:
Converts a string to a
UPowerGlib.DeviceState
.New in version 0.9.0.
- classmethod state_to_string(state_enum)¶
- Parameters:
state_enum (
UPowerGlib.DeviceState
) –- Returns:
identifier string
- Return type:
Converts a
UPowerGlib.DeviceState
to a string.New in version 0.9.0.
- classmethod technology_from_string(technology)¶
- Parameters:
technology (
str
) –- Returns:
enumerated value
- Return type:
Converts a string to a
UPowerGlib.DeviceTechnology
.New in version 0.9.0.
- classmethod technology_to_string(technology_enum)¶
- Parameters:
technology_enum (
UPowerGlib.DeviceTechnology
) –- Returns:
identifier string
- Return type:
Converts a
UPowerGlib.DeviceTechnology
to a string.New in version 0.9.0.
- get_history_sync(type, timespec, resolution, cancellable)¶
- Parameters:
type (
str
) – The type of history, known values are “rate” and “charge”.timespec (
int
) – the amount of time to look back into time.resolution (
int
) – the resolution of data.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
an array of
UPowerGlib.HistoryItem
's, with the most recent one being first;None
if error is set or self is invalid- Return type:
Gets the device history.
New in version 0.9.0.
- get_object_path()¶
-
Gets the object path for the device.
New in version 0.9.0.
- get_statistics_sync(type, cancellable)¶
- Parameters:
type (
str
) – the type of statistics.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
an array of
UPowerGlib.StatsItem
's, elseNone
and error is used- Return type:
Gets the device current statistics.
New in version 0.9.0.
- refresh_sync(cancellable)¶
- Parameters:
cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
- Return type:
Refreshes properties on the device. This function is normally not required and will only return without an error if the daemon was started in debug mode.
New in version 0.9.0.
- set_object_path_sync(object_path, cancellable)¶
- Parameters:
object_path (
str
) – The UPower object path.cancellable (
Gio.Cancellable
orNone
) – aGio.Cancellable
orNone
- Raises:
- Returns:
- Return type:
Sets the object path of the object and fills up initial properties.
New in version 0.9.0.
- to_text()¶
- Returns:
text representation of
UPowerGlib.Device
- Return type:
Converts the device to a string description.
New in version 0.9.0.
Property Details¶
- UPowerGlib.Device.props.battery_level¶
-
The battery level, e.g.
UPowerGlib.DeviceLevel.CRITICAL
. If this is something other thanUPowerGlib.DeviceLevel.NONE
, then User Interfaces should use this approximate level instead of percentages.New in version 1.0.
- UPowerGlib.Device.props.capacity¶
-
The percentage capacity of the device where 100% means the device has the same charge potential as when it was manufactured.
New in version 0.9.0.
- UPowerGlib.Device.props.charge_cycles¶
-
The number of charge cycles for the battery, or -1 if unknown or non-applicable.
New in version 1.0.
- UPowerGlib.Device.props.energy¶
-
The energy left in the device. Measured in mWh.
New in version 0.9.0.
- UPowerGlib.Device.props.energy_empty¶
-
The energy the device will have when it is empty. This is usually zero. Measured in mWh.
New in version 0.9.0.
- UPowerGlib.Device.props.energy_full¶
-
The amount of energy when the device is fully charged. Measured in mWh.
New in version 0.9.0.
- UPowerGlib.Device.props.energy_full_design¶
-
The amount of energy when the device was brand new. Measured in mWh.
New in version 0.9.0.
- UPowerGlib.Device.props.energy_rate¶
-
The rate of discharge or charge. Measured in mW.
New in version 0.9.0.
- UPowerGlib.Device.props.has_history¶
-
If the device has history data that might be useful.
New in version 0.9.0.
- UPowerGlib.Device.props.has_statistics¶
-
If the device has statistics data that might be useful.
New in version 0.9.0.
- UPowerGlib.Device.props.icon_name¶
-
The icon name, following the Icon Naming Speficiation
New in version 1.0.
- UPowerGlib.Device.props.is_present¶
-
If the device is present, as some devices like laptop batteries can be removed, leaving an empty bay that is still technically a device.
New in version 0.9.0.
- UPowerGlib.Device.props.is_rechargeable¶
-
If the device has a rechargable battery.
New in version 0.9.0.
- UPowerGlib.Device.props.kind¶
-
The device kind, e.g.
UPowerGlib.DeviceKind.KEYBOARD
.New in version 0.9.0.
- UPowerGlib.Device.props.luminosity¶
-
The current luminosity of the device.
New in version 0.9.19.
- UPowerGlib.Device.props.model¶
-
The model of the device.
New in version 0.9.0.
- UPowerGlib.Device.props.native_path¶
-
The native path of the device, useful for direct device access.
New in version 0.9.0.
- UPowerGlib.Device.props.online¶
-
If the device is online, i.e. connected.
New in version 0.9.0.
- UPowerGlib.Device.props.percentage¶
-
The percentage charge of the device. Note that if the battery level property is something other than
UPowerGlib.DeviceLevel.NONE
, then this percentage is an approximation, and should not be used a number to display to the user.New in version 0.9.0.
- UPowerGlib.Device.props.power_supply¶
-
If the device is powering the system.
New in version 0.9.0.
- UPowerGlib.Device.props.serial¶
-
The serial number of the device.
New in version 0.9.0.
- UPowerGlib.Device.props.state¶
-
The state the device is in at this time, e.g.
UPowerGlib.DeviceState.EMPTY
.New in version 0.9.0.
- UPowerGlib.Device.props.technology¶
-
The battery technology e.g.
UPowerGlib.DeviceTechnology.LITHIUM_ION
.New in version 0.9.0.
- UPowerGlib.Device.props.temperature¶
-
The temperature of the device in degrees Celsius.
New in version 0.9.22.
- UPowerGlib.Device.props.time_to_empty¶
-
The amount of time until the device is empty.
New in version 0.9.0.
- UPowerGlib.Device.props.time_to_full¶
-
The amount of time until the device is fully charged.
New in version 0.9.0.
- UPowerGlib.Device.props.update_time¶
-
The last time the device was updated.
New in version 0.9.0.
- UPowerGlib.Device.props.vendor¶
-
The vendor of the device.
New in version 0.9.0.
- UPowerGlib.Device.props.voltage¶
-
The current voltage of the device.
New in version 0.9.0.
- UPowerGlib.Device.props.warning_level¶
-
The warning level e.g.
UPowerGlib.DeviceLevel.CRITICAL
.New in version 1.0.