Fwupd.Device

g Fwupd.Device Fwupd.Device GObject.Object GObject.Object GObject.Object->Fwupd.Device

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

array_ensure_parents (devices)

class

array_filter_flags (devices, include, exclude)

class

array_from_variant (value)

class

flag_from_string (device_flag)

class

flag_to_string (device_flag)

class

from_variant (value)

class

id_is_valid (device_id)

class

new ()

class

problem_from_string (device_problem)

class

problem_to_string (device_problem)

add_checksum (checksum)

add_child (child)

add_flag (flag)

add_guid (guid)

add_icon (icon)

add_instance_id (instance_id)

add_issue (issue)

add_problem (problem)

add_protocol (protocol)

add_release (release)

add_request_flag (request_flag)

add_vendor_id (vendor_id)

compare (self2)

from_json (json_node)

get_battery_level ()

get_battery_threshold ()

get_branch ()

get_checksums ()

get_children ()

get_composite_id ()

get_created ()

get_description ()

get_flags ()

get_flashes_left ()

get_guid_default ()

get_guids ()

get_icons ()

get_id ()

get_install_duration ()

get_instance_ids ()

get_issues ()

get_modified ()

get_name ()

get_parent ()

get_parent_id ()

get_percentage ()

get_plugin ()

get_problems ()

get_protocol ()

get_protocols ()

get_release_default ()

get_releases ()

get_request_flags ()

get_root ()

get_serial ()

get_status ()

get_summary ()

get_update_error ()

get_update_image ()

get_update_message ()

get_update_state ()

get_vendor ()

get_vendor_id ()

get_vendor_ids ()

get_version ()

get_version_bootloader ()

get_version_bootloader_raw ()

get_version_build_date ()

get_version_format ()

get_version_lowest ()

get_version_lowest_raw ()

get_version_raw ()

has_checksum (checksum)

has_flag (flag)

has_guid (guid)

has_icon (icon)

has_instance_id (instance_id)

has_problem (problem)

has_protocol (protocol)

has_request_flag (request_flag)

has_vendor_id (vendor_id)

incorporate (donor)

match_flags (include, exclude)

remove_child (child)

remove_flag (flag)

remove_problem (problem)

remove_request_flag (request_flag)

set_battery_level (battery_level)

set_battery_threshold (battery_threshold)

set_branch (branch)

set_composite_id (composite_id)

set_created (created)

set_description (description)

set_flags (flags)

set_flashes_left (flashes_left)

set_id (id)

set_install_duration (duration)

set_modified (modified)

set_name (name)

set_parent (parent)

set_parent_id (parent_id)

set_percentage (percentage)

set_plugin (plugin)

set_problems (problems)

set_protocol (protocol)

set_request_flags (request_flags)

set_serial (serial)

set_status (status)

set_summary (summary)

set_update_error (update_error)

set_update_image (update_image)

set_update_message (update_message)

set_update_state (update_state)

set_vendor (vendor)

set_vendor_id (vendor_id)

set_version (version)

set_version_bootloader (version_bootloader)

set_version_bootloader_raw (version_bootloader_raw)

set_version_build_date (version_build_date)

set_version_format (version_format)

set_version_lowest (version_lowest)

set_version_lowest_raw (version_lowest_raw)

set_version_raw (version_raw)

to_json (builder)

to_json_full (builder, flags)

to_string ()

to_variant ()

to_variant_full (flags)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

battery-level

int

r/w

battery-threshold

int

r/w

flags

int

r/w

parent

Fwupd.Device

r/w/c

percentage

int

r/w

problems

int

r/w

protocol

str

r/w

deprecated

request-flags

int

r/w

status

int

r/w

update-error

str

r/w

update-image

str

r/w

update-message

str

r/w

update-state

int

r/w

version

str

r/w

version-format

int

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Fwupd.Device(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fwupd.DeviceClass

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:
Raises:

GLib.Error

Returns:

devices

Return type:

[Fwupd.Device]

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:

[Fwupd.Device]

Creates an array of new devices using serialized data.

New in version 1.2.10.

classmethod flag_from_string(device_flag)[source]
Parameters:

device_flag (str or None) – a string, e.g. require-ac

Returns:

enumerated value

Return type:

int

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:

str

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, or None if value was invalid

Return type:

Fwupd.Device

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:

True if guid was a fwupd device ID, False otherwise

Return type:

bool

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:

Fwupd.Device

Creates a new device.

New in version 0.9.3.

classmethod problem_from_string(device_problem)[source]
Parameters:

device_problem (str or None) – a string, e.g. require-ac

Returns:

enumerated value

Return type:

int

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:

str

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) – Another Fwupd.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:

int

Comparison function for comparing two device objects.

New in version 1.1.1.

from_json(json_node)[source]
Parameters:

json_node (Json.Node) – a JSON node

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

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:

int

Returns the battery level.

New in version 1.8.1.

get_battery_threshold()[source]
Returns:

value in percent

Return type:

int

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_branch()[source]
Returns:

the device branch, or None if unset

Return type:

str

Gets the current device branch.

New in version 1.5.0.

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:

[Fwupd.Device]

Gets the device children. These can only be assigned using Fwupd.Device.set_parent().

New in version 1.3.7.

get_composite_id()[source]
Returns:

the composite ID

Return type:

str or None

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:

int

Gets when the device was created.

New in version 0.9.3.

get_description()[source]
Returns:

the device description, or None if unset

Return type:

str

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:

int

Gets device flags.

New in version 0.9.3.

get_flashes_left()[source]
Returns:

the flash cycles left, or None if unset

Return type:

int

Gets the number of flash cycles left on the device

New in version 0.9.3.

get_guid_default()[source]
Returns:

the GUID, or None if unset

Return type:

str

Gets the default GUID.

New in version 0.9.3.

get_guids()[source]
Returns:

the GUIDs

Return type:

[str]

Gets the GUIDs.

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_id()[source]
Returns:

the ID, or None if unset

Return type:

str

Gets the ID.

New in version 0.9.3.

get_install_duration()[source]
Returns:

the estimated time to flash this device (or 0 if unset)

Return type:

int

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:

int

Gets when the device was modified.

New in version 0.9.3.

get_name()[source]
Returns:

the device name, or None if unset

Return type:

str

Gets the device name.

New in version 0.9.3.

get_parent()[source]
Returns:

the parent device, or None if unset

Return type:

Fwupd.Device

Gets the parent.

New in version 1.0.8.

get_parent_id()[source]
Returns:

the parent ID, or None if unset

Return type:

str

Gets the parent ID.

New in version 1.0.8.

get_percentage()[source]
Returns:

the percentage value

Return type:

int

Returns the percentage completion of the device.

New in version 1.8.11.

get_plugin()[source]
Returns:

the plugin name, or None if unset

Return type:

str

Gets the plugin that created the device.

New in version 1.0.0.

get_problems()[source]
Returns:

device problems, or 0 if unset

Return type:

int

Gets device problems.

New in version 1.8.1.

get_protocol()[source]
Returns:

the protocol name, or None if unset

Return type:

str

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, or None if not set

Return type:

Fwupd.Release

Gets the default release for this device.

New in version 0.9.8.

get_releases()[source]
Returns:

array of releases

Return type:

[Fwupd.Release]

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:

int

Gets device request flags.

New in version 1.9.10.

get_root()[source]
Returns:

the root device, or None if unset

Return type:

Fwupd.Device

Gets the device root.

New in version 1.7.4.

get_serial()[source]
Returns:

a string value, or None if never set.

Return type:

str

Gets the serial number for the device.

New in version 1.1.2.

get_status()[source]
Returns:

the status value, e.g. Fwupd.Status.DEVICE_WRITE

Return type:

Fwupd.Status

Returns what the device is currently doing.

New in version 1.4.0.

get_summary()[source]
Returns:

the device summary, or None if unset

Return type:

str

Gets the device summary.

New in version 0.9.3.

get_update_error()[source]
Returns:

the update error string, or None if unset

Return type:

str

Gets the update error string.

New in version 0.9.8.

get_update_image()[source]
Returns:

the update image URL, or None if unset

Return type:

str

Gets the update image URL.

New in version 1.4.5.

get_update_message()[source]
Returns:

the update message string, or None if unset

Return type:

str

Gets the update message string.

New in version 1.2.4.

get_update_state()[source]
Returns:

the update state, or Fwupd.UpdateState.UNKNOWN if unset

Return type:

Fwupd.UpdateState

Gets the update state.

New in version 0.9.8.

get_vendor()[source]
Returns:

the device vendor, or None if unset

Return type:

str

Gets the device vendor.

New in version 0.9.3.

get_vendor_id()[source]
Returns:

the device vendor, e.g. ‘USB:0x1234|PCI:0x5678’, or None if unset

Return type:

str

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()[source]
Returns:

the device version, or None if unset

Return type:

str

Gets the device version.

New in version 0.9.3.

get_version_bootloader()[source]
Returns:

the device version_bootloader, or None if unset

Return type:

str

Gets the version of the bootloader.

New in version 0.9.3.

get_version_bootloader_raw()[source]
Returns:

integer version number, or %0 if unset

Return type:

int

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:

int

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:

Fwupd.VersionFormat

Gets the version format.

New in version 1.2.9.

get_version_lowest()[source]
Returns:

the device version_lowest, or None if unset

Return type:

str

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:

int

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:

int

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:

bool

Finds out if the device has this specific checksum.

New in version 1.8.7.

has_flag(flag)[source]
Parameters:

flag (int) – the #FwupdDeviceFlags

Returns:

True if the flag is set

Return type:

bool

Finds if the device has a specific device flag.

New in version 0.9.3.

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

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:

bool

Finds out if the device has this specific vendor ID.

New in version 1.5.5.

incorporate(donor)[source]
Parameters:

donor (Fwupd.Device) – Another Fwupd.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:
Returns:

True if the device flags match

Return type:

bool

Check if the device flags match.

New in version 1.9.3.

remove_child(child)[source]
Parameters:

child (Fwupd.Device) – Another Fwupd.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_branch(branch)[source]
Parameters:

branch (str or None) – the device one line branch

Sets the current device branch.

New in version 1.5.0.

set_composite_id(composite_id)[source]
Parameters:

composite_id (str or None) – a device ID

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_description(description)[source]
Parameters:

description (str or None) – the description in AppStream markup format

Sets the device description.

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_id(id)[source]
Parameters:

id (str or None) – the device ID, e.g. USB:foo

Sets the ID.

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_name(name)[source]
Parameters:

name (str or None) – the device name, e.g. ColorHug2

Sets the device name.

New in version 0.9.3.

set_parent(parent)[source]
Parameters:

parent (Fwupd.Device or None) – another Fwupd.Device

Sets the parent. Only used internally.

New in version 1.0.8.

set_parent_id(parent_id)[source]
Parameters:

parent_id (str or None) – the device ID, e.g. USB:foo

Sets the parent ID.

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_plugin(plugin)[source]
Parameters:

plugin (str or None) – the plugin name, e.g. colorhug

Sets the plugin that created the device.

New in version 1.0.0.

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_serial(serial)[source]
Parameters:

serial (str or None) – the device serial number

Sets the serial number for the device.

New in version 1.1.2.

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_summary(summary)[source]
Parameters:

summary (str or None) – the device one line summary

Sets the device summary.

New in version 0.9.3.

set_update_error(update_error)[source]
Parameters:

update_error (str or None) – the update error string

Sets the update error string.

New in version 0.9.8.

set_update_image(update_image)[source]
Parameters:

update_image (str or None) – the update image URL

Sets the update image URL.

New in version 1.4.5.

set_update_message(update_message)[source]
Parameters:

update_message (str or None) – the update message string

Sets the update message string.

New in version 1.2.4.

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(vendor)[source]
Parameters:

vendor (str or None) – the vendor

Sets the device vendor.

New in version 0.9.3.

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(version)[source]
Parameters:

version (str or None) – the device version, e.g. 1.2.3

Sets the device version.

New in version 0.9.3.

set_version_bootloader(version_bootloader)[source]
Parameters:

version_bootloader (str or None) – the version

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]
Parameters:

version_lowest (str or None) – the version

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:

Adds a fwupd device to a JSON builder Optionally provides additional data based upon flags

New in version 1.8.2.

to_string()[source]
Returns:

text, or None for invalid

Return type:

str

Builds a text representation of the object.

New in version 0.9.3.

to_variant()[source]
Returns:

the serialized data, or None for error

Return type:

GLib.Variant

Serialize the device data omitting sensitive fields

New in version 1.0.0.

to_variant_full(flags)[source]
Parameters:

flags (int) – device flags

Returns:

the serialized data, or None for error

Return type:

GLib.Variant

Serialize the device data. Optionally provides additional data based upon flags

New in version 1.1.2.

Property Details

Fwupd.Device.props.battery_level
Name:

battery-level

Type:

int

Default Value:

101

Flags:

READABLE, WRITABLE

The device battery level in percent.

New in version 1.5.8.

Fwupd.Device.props.battery_threshold
Name:

battery-threshold

Type:

int

Default Value:

101

Flags:

READABLE, WRITABLE

The device battery threshold in percent.

New in version 1.5.8.

Fwupd.Device.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The device flags.

New in version 0.9.3.

Fwupd.Device.props.parent
Name:

parent

Type:

Fwupd.Device

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The device parent.

New in version 1.0.8.

Fwupd.Device.props.percentage
Name:

percentage

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The current device percentage.

New in version 1.8.11.

Fwupd.Device.props.problems
Name:

problems

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The problems with the device that the user could fix, e.g. “lid open”.

New in version 1.8.1.

Fwupd.Device.props.protocol
Name:

protocol

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The device protocol.

New in version 1.3.6.

Deprecated since version 1.5.8.

Fwupd.Device.props.request_flags
Name:

request-flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The device request flags.

New in version 1.9.10.

Fwupd.Device.props.status
Name:

status

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The current device status.

New in version 1.4.0.

Fwupd.Device.props.update_error
Name:

update-error

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The device update error.

New in version 0.9.8.

Fwupd.Device.props.update_image
Name:

update-image

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The update image for the device.

New in version 1.4.5.

Fwupd.Device.props.update_message
Name:

update-message

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The device update message.

New in version 1.2.4.

Fwupd.Device.props.update_state
Name:

update-state

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The device update state.

New in version 0.9.8.

Fwupd.Device.props.version
Name:

version

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The device version.

New in version 1.8.15.

Fwupd.Device.props.version_format
Name:

version-format

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The version format of the device.

New in version 1.2.9.