Fwupd.Device¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
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 |
|||
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.
New in version 1.3.7.
- classmethod array_filter_flags(devices, include, exclude)[source]¶
- Parameters:
devices ([
Fwupd.Device
]) – devicesinclude (
int
) – #FwupdDeviceFlags, orFwupd.DEVICE_FLAG_NONE
exclude (
int
) – #FwupdDeviceFlags, orFwupd.DEVICE_FLAG_NONE
- Raises:
- Returns:
devices
- Return type:
Creates an array of new devices that match using
Fwupd.Device.match_flags
().New in version 1.9.3.
- classmethod array_from_variant(value)[source]¶
- Parameters:
value (
GLib.Variant
) – the serialized data- Returns:
devices, or
None
if value was invalid- Return type:
Creates an array of new devices using serialized data.
New in version 1.2.10.
- classmethod flag_from_string(device_flag)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to an enumerated device flag.
New in version 0.7.0.
- classmethod flag_to_string(device_flag)[source]¶
- Parameters:
device_flag (
int
) – a device flag, e.g.Fwupd.DEVICE_FLAG_REQUIRE_AC
- Returns:
identifier string
- Return type:
Converts a device flag to a string.
New in version 0.7.0.
- classmethod from_variant(value)[source]¶
- Parameters:
value (
GLib.Variant
) – the serialized data- Returns:
a new
Fwupd.Device
, orNone
if value was invalid- Return type:
Creates a new device using serialized data.
New in version 1.0.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.New in version 1.4.1.
- classmethod new()[source]¶
- Returns:
a new
Fwupd.Device
- Return type:
Creates a new device.
New in version 0.9.3.
- classmethod problem_from_string(device_problem)[source]¶
- Parameters:
- Returns:
enumerated value
- Return type:
Converts a string to a enumerated device inhibit kind.
New in version 1.8.1.
- classmethod problem_to_string(device_problem)[source]¶
- Parameters:
device_problem (
int
) – a device inhibit kind, e.g.Fwupd.DEVICE_PROBLEM_SYSTEM_POWER_TOO_LOW
- Returns:
identifier string
- Return type:
Converts a device inhibit kind to a string.
New in version 1.8.1.
- add_checksum(checksum)[source]¶
- Parameters:
checksum (
str
) – the device checksum
Adds a device checksum.
New 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.New in version 1.5.1.
- add_flag(flag)[source]¶
- Parameters:
flag (
int
) – the #FwupdDeviceFlags
Adds a specific device flag to the device.
New 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.
New in version 0.9.3.
- add_icon(icon)[source]¶
- Parameters:
icon (
str
) – the icon name, e.g.input-mouse
or/usr/share/icons/foo.png
Adds the icon name if it does not already exist.
New 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.
New 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.
New in version 1.7.6.
- add_problem(problem)[source]¶
- Parameters:
problem (
int
) – the #FwupdDeviceProblem, e.g.Fwupd.DEVICE_PROBLEM_SYSTEM_POWER_TOO_LOW
Adds a specific device problem kind to the device.
New 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.
New in version 1.5.8.
- add_release(release)[source]¶
- Parameters:
release (
Fwupd.Release
) – a release
Adds a release for this device.
New in version 0.9.8.
- add_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
int
) – the #FwupdRequestFlags
Adds a specific device request flag to the device.
New 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.
New 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.
New in version 1.1.1.
- from_json(json_node)[source]¶
-
Loads a fwupd security attribute from a JSON node.
New in version 1.8.3.
- get_battery_level()[source]¶
- Returns:
value in percent
- Return type:
Returns the battery level.
New 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.New in version 1.8.1.
- get_checksums()[source]¶
- Returns:
the checksums, which may be empty
- Return type:
[
str
]
Gets the device checksums.
New 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
().New 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.
New in version 1.6.0.
- get_created()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets when the device was created.
New in version 0.9.3.
- get_description()[source]¶
-
Gets the device description in AppStream markup format.
New in version 0.9.3.
- get_flags()[source]¶
- Returns:
device flags, or 0 if unset
- Return type:
Gets device flags.
New in version 0.9.3.
- get_flashes_left()[source]¶
-
Gets the number of flash cycles left on the device
New 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.
New 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)
New in version 1.1.3.
- get_instance_ids()[source]¶
- Returns:
the instance IDs
- Return type:
[
str
]
Gets the instance IDs.
New 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.
New in version 1.7.6.
- get_modified()[source]¶
- Returns:
the UNIX time, or 0 if unset
- Return type:
Gets when the device was modified.
New in version 0.9.3.
- get_parent()[source]¶
- Returns:
the parent device, or
None
if unset- Return type:
Gets the parent.
New in version 1.0.8.
- get_percentage()[source]¶
- Returns:
the percentage value
- Return type:
Returns the percentage completion of the device.
New in version 1.8.11.
- get_problems()[source]¶
- Returns:
device problems, or 0 if unset
- Return type:
Gets device problems.
New in version 1.8.1.
- get_protocol()[source]¶
-
Gets the protocol name that the device uses for updating.
New in version 1.3.6.
Deprecated since version 1.5.8: Use
Fwupd.Device.get_protocols
() instead.
- get_protocols()[source]¶
- Returns:
the device protocol names
- Return type:
[
str
]
Gets the device protocol names.
New in version 1.5.8.
- get_release_default()[source]¶
- Returns:
the
Fwupd.Release
, orNone
if not set- Return type:
Gets the default release for this device.
New in version 0.9.8.
- get_releases()[source]¶
- Returns:
array of releases
- Return type:
Gets all the releases for this device.
New in version 0.9.8.
- get_request_flags()[source]¶
- Returns:
device request flags, or 0 if unset
- Return type:
Gets device request flags.
New in version 1.9.10.
- get_root()[source]¶
- Returns:
the root device, or
None
if unset- Return type:
Gets the device root.
New 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.
New in version 1.4.0.
- get_update_state()[source]¶
- Returns:
the update state, or
Fwupd.UpdateState.UNKNOWN
if unset- Return type:
Gets the update state.
New in version 0.9.8.
- get_vendor_id()[source]¶
-
Gets the combined device vendor ID.
New in version 0.9.4.
Deprecated since version 1.5.5: Use
Fwupd.Device.get_vendor_ids
() instead.
- get_vendor_ids()[source]¶
- Returns:
the device vendor ID
- Return type:
[
str
]
Gets the device vendor ID.
New 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.
New 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.
New in version 1.6.2.
- get_version_format()[source]¶
- Returns:
the version format, or
Fwupd.VersionFormat.UNKNOWN
if unset- Return type:
Gets the version format.
New in version 1.2.9.
- get_version_lowest()[source]¶
-
Gets the lowest version of firmware the device will accept.
New 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.
New 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.
New in version 1.3.6.
- has_checksum(checksum)[source]¶
- Parameters:
checksum (
str
) – the device checksum- Returns:
True
if the checksum name is found- Return type:
Finds out if the device has this specific checksum.
New in version 1.8.7.
- has_guid(guid)[source]¶
- Parameters:
guid (
str
) – the GUID, e.g.2082b5e0-7a64-478a-b1b2-e3404fab6dad
- Returns:
True
if the GUID is found- Return type:
Finds out if the device has this specific GUID.
New in version 0.9.3.
- has_icon(icon)[source]¶
- Parameters:
icon (
str
) – the icon name, e.g.input-mouse
or/usr/share/icons/foo.png
- Returns:
True
if the icon name is found- Return type:
Finds out if the device has this specific icon.
New 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:
True
if the instance ID is found- Return type:
Finds out if the device has this specific instance ID.
New in version 1.2.5.
- has_problem(problem)[source]¶
- Parameters:
problem (
int
) – the #FwupdDeviceProblem- Returns:
True
if the problem is set- Return type:
Finds if the device has a specific device problem kind.
New in version 1.8.1.
- has_protocol(protocol)[source]¶
- Parameters:
protocol (
str
) – the protocol name, e.g.com.hughski.colorhug
- Returns:
True
if the protocol name is found- Return type:
Finds out if the device has this specific protocol name.
New in version 1.5.8.
- has_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
int
) – the #FwupdRequestFlags- Returns:
True
if the request_flag is set- Return type:
Finds if the device has a specific device request flag.
New in version 1.9.10.
- has_vendor_id(vendor_id)[source]¶
- Parameters:
vendor_id (
str
) – the vendor ID, e.g. ‘USB:0x1234’- Returns:
True
if the vendor ID is found- Return type:
Finds out if the device has this specific vendor ID.
New 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.
New in version 1.1.0.
- match_flags(include, exclude)[source]¶
- Parameters:
include (
int
) – #FwupdDeviceFlags, orFwupd.DEVICE_FLAG_NONE
exclude (
int
) – #FwupdDeviceFlags, orFwupd.DEVICE_FLAG_NONE
- Returns:
True
if the device flags match- Return type:
Check if the device flags match.
New 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.
New in version 1.6.2.
- remove_flag(flag)[source]¶
- Parameters:
flag (
int
) – the #FwupdDeviceFlags
Removes a specific device flag from the device.
New in version 0.9.3.
- remove_problem(problem)[source]¶
- Parameters:
problem (
int
) – the #FwupdDeviceProblem, e.g.Fwupd.DEVICE_PROBLEM_SYSTEM_POWER_TOO_LOW
Removes a specific device problem kind from the device.
New in version 1.8.1.
- remove_request_flag(request_flag)[source]¶
- Parameters:
request_flag (
int
) – the #FwupdRequestFlags
Removes a specific device request flag from the device.
New 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.
New 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_INVALID
for the default.Setting this allows fwupd to show a warning if the device change is too low to perform the update.
New 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.
New in version 1.6.0.
- set_created(created)[source]¶
- Parameters:
created (
int
) – the UNIX time
Sets when the device was created.
New in version 0.9.3.
- set_flags(flags)[source]¶
- Parameters:
flags (
int
) – device flags, e.g.Fwupd.DEVICE_FLAG_REQUIRE_AC
Sets device flags.
New 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
New 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)
New in version 1.1.3.
- set_modified(modified)[source]¶
- Parameters:
modified (
int
) – the UNIX time
Sets when the device was modified.
New in version 0.9.3.
- set_parent(parent)[source]¶
- Parameters:
parent (
Fwupd.Device
orNone
) – anotherFwupd.Device
Sets the parent. Only used internally.
New in version 1.0.8.
- set_percentage(percentage)[source]¶
- Parameters:
percentage (
int
) – the percentage value
Sets the percentage completion of the device.
New in version 1.8.11.
- set_problems(problems)[source]¶
- Parameters:
problems (
int
) – device problems, e.g.Fwupd.DEVICE_PROBLEM_SYSTEM_POWER_TOO_LOW
Sets device problems.
New in version 1.8.1.
- set_protocol(protocol)[source]¶
- Parameters:
protocol (
str
) – the protocol name, e.g.com.hughski.colorhug
Sets the protocol name that is used to update the device.
New in version 1.3.6.
Deprecated since version 1.5.8: Use
Fwupd.Device.add_protocol
() instead.
- 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.
New 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.
New 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.
New in version 0.9.8.
- set_vendor_id(vendor_id)[source]¶
- Parameters:
vendor_id (
str
) – the vendor ID, e.g. ‘USB:0x1234’ or ‘USB:0x1234|PCI:0x5678’
Sets the device vendor ID.
New in version 0.9.4.
Deprecated since version 1.5.5: Use
Fwupd.Device.add_vendor_id
() instead.
- set_version_bootloader(version_bootloader)[source]¶
-
Sets the bootloader version.
New 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.
New 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.
New 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.
New in version 1.2.9.
- set_version_lowest(version_lowest)[source]¶
-
Sets the lowest version of firmware the device will accept.
New in version 0.9.3.
- set_version_lowest_raw(version_lowest_raw)[source]¶
- Parameters:
version_lowest_raw (
int
) – the raw hardware version
Sets the raw lowest version number from the hardware before converted to a string.
New in version 1.4.0.
- set_version_raw(version_raw)[source]¶
- Parameters:
version_raw (
int
) – the raw hardware version
Sets the raw version number from the hardware before converted to a string.
New in version 1.3.6.
- to_json(builder)[source]¶
- Parameters:
builder (
Json.Builder
) – a JSON builder
Adds a fwupd device to a JSON builder
New in version 1.2.6.
- to_json_full(builder, flags)[source]¶
- Parameters:
builder (
Json.Builder
) – a JSON builderflags (
int
) – device flags
Adds a fwupd device to a JSON builder Optionally provides additional data based upon flags
New in version 1.8.2.
- to_variant()[source]¶
- Returns:
the serialized data, or
None
for error- Return type:
Serialize the device data omitting sensitive fields
New in version 1.0.0.
Property Details¶
- Fwupd.Device.props.battery_level¶
-
The device battery level in percent.
New in version 1.5.8.
- Fwupd.Device.props.battery_threshold¶
-
The device battery threshold in percent.
New in version 1.5.8.
- Fwupd.Device.props.flags¶
-
The device flags.
New in version 0.9.3.
- Fwupd.Device.props.parent¶
- Name:
parent
- Type:
- Default Value:
- Flags:
The device parent.
New in version 1.0.8.
- Fwupd.Device.props.percentage¶
-
The current device percentage.
New in version 1.8.11.
- Fwupd.Device.props.problems¶
-
The problems with the device that the user could fix, e.g. “lid open”.
New in version 1.8.1.
- Fwupd.Device.props.protocol¶
-
The device protocol.
New in version 1.3.6.
Deprecated since version 1.5.8.
- Fwupd.Device.props.request_flags¶
-
The device request flags.
New in version 1.9.10.
- Fwupd.Device.props.status¶
-
The current device status.
New in version 1.4.0.
- Fwupd.Device.props.update_error¶
-
The device update error.
New in version 0.9.8.
- Fwupd.Device.props.update_image¶
-
The update image for the device.
New in version 1.4.5.
- Fwupd.Device.props.update_message¶
-
The device update message.
New in version 1.2.4.
- Fwupd.Device.props.update_state¶
-
The device update state.
New in version 0.9.8.
- Fwupd.Device.props.version¶
-
The device version.
New in version 1.8.15.