Fwupd.Device¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
|||
r/w |
|||
r/w |
|||
r/w |
|||
r/w/c |
|||
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_instance |
r |
Class Details¶
- class Fwupd.Device(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A physical device on the host with optionally updatable firmware.
See also: [class`FwupdRelease`]
- classmethod array_ensure_parents(devices)[source]¶
- Parameters:
devices ([
Fwupd.Device]) – devices
Sets the parent object on all devices in the array using the parent ID.
Added in version 1.3.7.
- classmethod array_filter_flags(devices, include, exclude)[source]¶
- Parameters:
devices ([
Fwupd.Device]) – devicesinclude (
Fwupd.DeviceFlags) –Fwupd.DeviceFlags, orFwupd.DeviceFlags.NONEexclude (
Fwupd.DeviceFlags) –Fwupd.DeviceFlags, orFwupd.DeviceFlags.NONE
- Raises:
- Returns:
devices
- Return type:
Creates an array of new devices that match using
Fwupd.Device.match_flags().Added in version 1.9.3.
- classmethod flag_from_string(val)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated value.
Added in version 0.7.0.
- classmethod flag_to_string(val)[source]¶
- Parameters:
val (
Fwupd.DeviceFlags) – value, e.g.Fwupd.DeviceFlags.INTERNAL- Returns:
identifier string
- Return type:
Converts an enumerated value to a string.
Added in version 0.7.0.
- classmethod id_is_valid(device_id)[source]¶
- Parameters:
device_id (
str) – string to check, e.g.d3fae86d95e5d56626129d00e332c4b8dac95442- Returns:
- Return type:
Checks the string is a valid non-partial device ID. It is important to note that the wildcard ID of
*is not considered a valid ID in this function and the client must check for this manually if this should be allowed.Added in version 1.4.1.
- classmethod new()[source]¶
- Returns:
a new
Fwupd.Device- Return type:
Creates a new device.
Added in version 0.9.3.
- classmethod problem_from_string(val)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated value.
Added in version 1.8.1.
- classmethod problem_to_string(val)[source]¶
- Parameters:
val (
Fwupd.DeviceProblem) – value, e.g.Fwupd.DeviceProblem.SYSTEM_POWER_TOO_LOW- Returns:
identifier string
- Return type:
Converts an enumerated value to a string.
Added in version 1.8.1.
- add_checksum(checksum)[source]¶
- Parameters:
checksum (
str) – the device checksum
Adds a device checksum.
Added in version 0.9.3.
- add_child(child)[source]¶
- Parameters:
child (
Fwupd.Device) – AnotherFwupd.Device
Adds a child device. An child device is logically linked to the primary device in some way.
NOTE: You should never call this function from user code, it is for daemon use only. Only use
Fwupd.Device.set_parent() to set up a logical tree.Added in version 1.5.1.
- add_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.DeviceFlags) – theFwupd.DeviceFlags
Adds a specific device flag to the device.
Added in version 0.9.3.
- add_guid(guid)[source]¶
- Parameters:
guid (
str) – the GUID, e.g.2082b5e0-7a64-478a-b1b2-e3404fab6dad
Adds the GUID if it does not already exist.
Added in version 0.9.3.
- add_icon(icon)[source]¶
- Parameters:
icon (
str) – the icon name, e.g.input-mouseor/usr/share/icons/foo.png
Adds the icon name if it does not already exist.
Added in version 0.9.8.
- add_instance_id(instance_id)[source]¶
- Parameters:
instance_id (
str) – the instance ID, e.g.PCI\VEN_10EC&DEV_525A
Adds the instance ID if it does not already exist.
Added in version 1.2.5.
- add_issue(issue)[source]¶
- Parameters:
issue (
str) – the update issue, e.g.CVE-2019-12345
Adds an current issue to this device.
Added in version 1.7.6.
- add_problem(problem)[source]¶
- Parameters:
problem (
Fwupd.DeviceProblem) – theFwupd.DeviceProblem, e.g.Fwupd.DeviceProblem.SYSTEM_POWER_TOO_LOW
Adds a specific device problem kind to the device.
Added in version 1.8.1.
- add_protocol(protocol)[source]¶
- Parameters:
protocol (
str) – the protocol name, e.g.com.hughski.colorhug
Adds a device protocol name.
Added in version 1.5.8.
- add_release(release)[source]¶
- Parameters:
release (
Fwupd.Release) – a release
Adds a release for this device.
Added in version 0.9.8.
- add_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
Fwupd.RequestFlags) – theFwupd.RequestFlags
Adds a specific device request flag to the device.
Added in version 1.9.10.
- add_vendor_id(vendor_id)[source]¶
- Parameters:
vendor_id (
str) – the ID, e.g. ‘USB:0x1234’
Adds a device vendor ID.
Added in version 1.5.5.
- compare(self2)[source]¶
- Parameters:
self2 (
Fwupd.Device) – a different device- Returns:
negative, 0 or positive
- Return type:
Comparison function for comparing two device objects.
Added in version 1.1.1.
- get_battery_level()[source]¶
- Returns:
value in percent
- Return type:
Returns the battery level.
Added in version 1.8.1.
- get_battery_threshold()[source]¶
- Returns:
value in percent
- Return type:
Returns the battery threshold under which a firmware update cannot be performed.
If
Fwupd.Device.set_battery_threshold() has not been used, a default value is used instead.Added in version 1.8.1.
- get_checksums()[source]¶
- Returns:
the checksums, which may be empty
- Return type:
[
str]
Gets the device checksums.
Added in version 0.9.3.
- get_children()[source]¶
- Returns:
the children, which may be empty
- Return type:
Gets the device children. These can only be assigned using
Fwupd.Device.set_parent().Added in version 1.3.7.
- get_composite_id()[source]¶
-
Gets the composite ID, falling back to the device ID if unset.
The composite ID will be the same value for all parent, child and sibling devices.
Added in version 1.6.0.
- get_created()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets when the device was created.
Added in version 0.9.3.
- get_flags()[source]¶
- Returns:
device flags, or 0 if unset
- Return type:
Gets device flags.
Added in version 0.9.3.
- get_flashes_left()[source]¶
-
Gets the number of flash cycles left on the device
Added in version 0.9.3.
- get_icons()[source]¶
- Returns:
an array of icon names
- Return type:
[
str]
Gets the icon names to use for the device.
NOTE: Icons specified without a full path are stock icons and should be loaded from the users icon theme.
Added in version 0.9.8.
- get_install_duration()[source]¶
- Returns:
the estimated time to flash this device (or 0 if unset)
- Return type:
Gets the time estimate for firmware installation (in seconds)
Added in version 1.1.3.
- get_instance_ids()[source]¶
- Returns:
the instance IDs
- Return type:
[
str]
Gets the instance IDs.
Added in version 1.2.5.
- get_issues()[source]¶
- Returns:
the issues, which may be empty
- Return type:
[
str]
Gets the list of issues currently affecting this device.
Added in version 1.7.6.
- get_modified()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets when the device was modified.
Added in version 0.9.3.
- get_parent()[source]¶
- Returns:
the parent device, or
Noneif unset- Return type:
Gets the parent.
Added in version 1.0.8.
- get_percentage()[source]¶
- Returns:
the percentage value
- Return type:
Returns the percentage completion of the device.
Added in version 1.8.11.
- get_problems()[source]¶
- Returns:
device problems, or 0 if unset
- Return type:
Gets device problems.
Added in version 1.8.1.
- get_protocols()[source]¶
- Returns:
the device protocol names
- Return type:
[
str]
Gets the device protocol names.
Added in version 1.5.8.
- get_release_default()[source]¶
- Returns:
the
Fwupd.Release, orNoneif not set- Return type:
Gets the default release for this device.
Added in version 0.9.8.
- get_releases()[source]¶
- Returns:
array of releases
- Return type:
Gets all the releases for this device.
Added in version 0.9.8.
- get_request_flags()[source]¶
- Returns:
device request flags, or 0 if unset
- Return type:
Gets device request flags.
Added in version 1.9.10.
- get_root()[source]¶
- Returns:
the root device, or
Noneif unset- Return type:
Gets the device root.
Added in version 1.7.4.
- get_status()[source]¶
- Returns:
the status value, e.g.
Fwupd.Status.DEVICE_WRITE- Return type:
Returns what the device is currently doing.
Added in version 1.4.0.
- get_update_state()[source]¶
- Returns:
the update state, or
Fwupd.UpdateState.UNKNOWNif unset- Return type:
Gets the update state.
Added in version 0.9.8.
- get_vendor_ids()[source]¶
- Returns:
the device vendor ID
- Return type:
[
str]
Gets the device vendor ID.
Added in version 1.5.5.
- get_version_bootloader_raw()[source]¶
- Returns:
integer version number, or %0 if unset
- Return type:
Gets the bootloader version of firmware the device will accept in raw format.
Added in version 1.4.0.
- get_version_build_date()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets the date when the firmware was built.
Added in version 1.6.2.
- get_version_format()[source]¶
- Returns:
the version format, or
Fwupd.VersionFormat.UNKNOWNif unset- Return type:
Gets the version format.
Added in version 1.2.9.
- get_version_highest()[source]¶
-
Gets the highest version of firmware the device will accept.
Added in version 2.1.2.
- get_version_highest_raw()[source]¶
- Returns:
integer version number, or %0 if unset
- Return type:
Gets the highest version of firmware the device will accept in raw format.
Added in version 2.1.2.
- get_version_lowest()[source]¶
-
Gets the lowest version of firmware the device will accept.
Added in version 0.9.3.
- get_version_lowest_raw()[source]¶
- Returns:
integer version number, or %0 if unset
- Return type:
Gets the lowest version of firmware the device will accept in raw format.
Added in version 1.4.0.
- get_version_raw()[source]¶
- Returns:
the hardware version, or 0 if unset
- Return type:
Gets the raw version number from the hardware before converted to a string.
Added in version 1.3.6.
- has_checksum(checksum)[source]¶
- Parameters:
checksum (
str) – the device checksum- Returns:
Trueif the checksum name is found- Return type:
Finds out if the device has this specific checksum.
Added in version 1.8.7.
- has_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.DeviceFlags) – theFwupd.DeviceFlags- Returns:
Trueif the flag is set- Return type:
Finds if the device has a specific device flag.
Added in version 0.9.3.
- has_guid(guid)[source]¶
- Parameters:
guid (
str) – the GUID, e.g.2082b5e0-7a64-478a-b1b2-e3404fab6dad- Returns:
Trueif the GUID is found- Return type:
Finds out if the device has this specific GUID.
Added in version 0.9.3.
- has_icon(icon)[source]¶
- Parameters:
icon (
str) – the icon name, e.g.input-mouseor/usr/share/icons/foo.png- Returns:
Trueif the icon name is found- Return type:
Finds out if the device has this specific icon.
Added in version 1.6.2.
- has_instance_id(instance_id)[source]¶
- Parameters:
instance_id (
str) – the instance ID, e.g.PCI\VEN_10EC&DEV_525A- Returns:
Trueif the instance ID is found- Return type:
Finds out if the device has this specific instance ID.
Added in version 1.2.5.
- has_problem(problem)[source]¶
- Parameters:
problem (
Fwupd.DeviceProblem) – theFwupd.DeviceProblem- Returns:
Trueif the problem is set- Return type:
Finds if the device has a specific device problem kind.
Added in version 1.8.1.
- has_protocol(protocol)[source]¶
- Parameters:
protocol (
str) – the protocol name, e.g.com.hughski.colorhug- Returns:
Trueif the protocol name is found- Return type:
Finds out if the device has this specific protocol name.
Added in version 1.5.8.
- has_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
Fwupd.RequestFlags) – theFwupd.RequestFlags- Returns:
Trueif the request_flag is set- Return type:
Finds if the device has a specific device request flag.
Added in version 1.9.10.
- has_vendor_id(vendor_id)[source]¶
- Parameters:
vendor_id (
str) – the vendor ID, e.g. ‘USB:0x1234’- Returns:
Trueif the vendor ID is found- Return type:
Finds out if the device has this specific vendor ID.
Added in version 1.5.5.
- incorporate(donor)[source]¶
- Parameters:
donor (
Fwupd.Device) – AnotherFwupd.Device
Copy all properties from the donor object if they have not already been set.
Added in version 1.1.0.
- match_flags(include, exclude)[source]¶
- Parameters:
include (
Fwupd.DeviceFlags) –Fwupd.DeviceFlags, orFwupd.DeviceFlags.NONEexclude (
Fwupd.DeviceFlags) –Fwupd.DeviceFlags, orFwupd.DeviceFlags.NONE
- Returns:
Trueif the device flags match- Return type:
Check if the device flags match.
Added in version 1.9.3.
- remove_child(child)[source]¶
- Parameters:
child (
Fwupd.Device) – AnotherFwupd.Device
Removes a child device.
NOTE: You should never call this function from user code, it is for daemon use only.
Added in version 1.6.2.
- remove_children()[source]¶
Removes all child devices.
NOTE: You should never call this function from user code, it is for daemon use only.
Added in version 2.0.0.
- remove_flag(flag)[source]¶
- Parameters:
flag (
Fwupd.DeviceFlags) – theFwupd.DeviceFlags
Removes a specific device flag from the device.
Added in version 0.9.3.
- remove_problem(problem)[source]¶
- Parameters:
problem (
Fwupd.DeviceProblem) – theFwupd.DeviceProblem, e.g.Fwupd.DeviceProblem.SYSTEM_POWER_TOO_LOW
Removes a specific device problem kind from the device.
Added in version 1.8.1.
- remove_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
Fwupd.RequestFlags) – theFwupd.RequestFlags
Removes a specific device request flag from the device.
Added in version 1.9.10.
- set_battery_level(battery_level)[source]¶
- Parameters:
battery_level (
int) – the percentage value
Sets the battery level, or
Fwupd.BATTERY_LEVEL_INVALID.Setting this allows fwupd to show a warning if the device change is too low to perform the update.
Added in version 1.8.1.
- set_battery_threshold(battery_threshold)[source]¶
- Parameters:
battery_threshold (
int) – the percentage value
Sets the battery level, or
Fwupd.BATTERY_LEVEL_INVALIDfor the default.Setting this allows fwupd to show a warning if the device change is too low to perform the update.
Added in version 1.8.1.
- set_composite_id(composite_id)[source]¶
-
Sets the composite ID, which is usually a SHA1 hash of a grandparent or parent device.
Added in version 1.6.0.
- set_created(created)[source]¶
- Parameters:
created (
int) – the UNIX time
Sets when the device was created.
Added in version 0.9.3.
- set_flags(flags)[source]¶
- Parameters:
flags (
int) – device flags, e.g.Fwupd.DeviceFlags.REQUIRE_AC
Sets device flags.
Added in version 0.9.3.
- set_flashes_left(flashes_left)[source]¶
- Parameters:
flashes_left (
int) – the description
Sets the number of flash cycles left on the device
Added in version 0.9.3.
- set_install_duration(duration)[source]¶
- Parameters:
duration (
int) – the amount of time
Sets the time estimate for firmware installation (in seconds)
Added in version 1.1.3.
- set_modified(modified)[source]¶
- Parameters:
modified (
int) – the UNIX time
Sets when the device was modified.
Added in version 0.9.3.
- set_parent(parent)[source]¶
- Parameters:
parent (
Fwupd.DeviceorNone) – anotherFwupd.Device
Sets the parent. Only used internally.
Added in version 1.0.8.
- set_percentage(percentage)[source]¶
- Parameters:
percentage (
int) – the percentage value
Sets the percentage completion of the device.
Added in version 1.8.11.
- set_problems(problems)[source]¶
- Parameters:
problems (
int) – device problems, e.g.Fwupd.DeviceProblem.SYSTEM_POWER_TOO_LOW
Sets device problems.
Added in version 1.8.1.
- set_request_flags(request_flags)[source]¶
- Parameters:
request_flags (
int) – device request flags, e.g. %FWUPD_DEVICE_REQUEST_FLAG_REQUIRE_AC
Sets device request flags.
Added in version 1.9.10.
- set_status(status)[source]¶
- Parameters:
status (
Fwupd.Status) – the status value, e.g.Fwupd.Status.DEVICE_WRITE
Sets what the device is currently doing.
Added in version 1.4.0.
- set_update_state(update_state)[source]¶
- Parameters:
update_state (
Fwupd.UpdateState) – the state, e.g.Fwupd.UpdateState.PENDING
Sets the update state.
Added in version 0.9.8.
- set_version_bootloader(version_bootloader)[source]¶
-
Sets the bootloader version.
Added in version 0.9.3.
- set_version_bootloader_raw(version_bootloader_raw)[source]¶
- Parameters:
version_bootloader_raw (
int) – the raw hardware version
Sets the raw bootloader version number from the hardware before converted to a string.
Added in version 1.4.0.
- set_version_build_date(version_build_date)[source]¶
- Parameters:
version_build_date (
int) – the UNIX time
Sets the date when the firmware was built.
Added in version 1.6.2.
- set_version_format(version_format)[source]¶
- Parameters:
version_format (
Fwupd.VersionFormat) – the version format, e.g.Fwupd.VersionFormat.NUMBER
Sets the version format.
Added in version 1.2.9.
- set_version_highest(version_highest)[source]¶
-
Sets the highest version of firmware the device will accept.
Added in version 2.1.2.
- set_version_highest_raw(version_highest_raw)[source]¶
- Parameters:
version_highest_raw (
int) – the raw highest version
Sets the raw highest version number from the hardware before being converted to a string.
Added in version 2.1.2.
- set_version_lowest(version_lowest)[source]¶
-
Sets the lowest version of firmware the device will accept.
Added in version 0.9.3.
Property Details¶
- Fwupd.Device.props.battery_level¶
-
The device battery level in percent.
Added in version 1.5.8.
- Fwupd.Device.props.battery_threshold¶
-
The device battery threshold in percent.
Added in version 1.5.8.
- Fwupd.Device.props.flags¶
-
The device flags.
Added in version 0.9.3.
- Fwupd.Device.props.id¶
-
The device ID.
Added in version 2.0.0.
- Fwupd.Device.props.parent¶
- Name:
parent- Type:
- Default Value:
- Flags:
The device parent.
Added in version 1.0.8.
- Fwupd.Device.props.percentage¶
-
The current device percentage.
Added in version 1.8.11.
- Fwupd.Device.props.problems¶
-
The problems with the device that the user could fix, e.g. “lid open”.
Added in version 1.8.1.
- Fwupd.Device.props.request_flags¶
-
The device request flags.
Added in version 1.9.10.
- Fwupd.Device.props.status¶
-
The current device status.
Added in version 1.4.0.
- Fwupd.Device.props.update_error¶
-
The device update error.
Added in version 0.9.8.
- Fwupd.Device.props.update_state¶
-
The device update state.
Added in version 0.9.8.
- Fwupd.Device.props.vendor¶
-
The device vendor.
Added in version 2.0.17.
- Fwupd.Device.props.version¶
-
The device version.
Added in version 1.8.15.