Fwupd.BiosSetting

g Fwupd.BiosSetting Fwupd.BiosSetting GObject.Object GObject.Object GObject.Object->Fwupd.BiosSetting

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

array_from_variant (value)

class

from_variant (value)

class

new (name, path)

add_possible_value (possible_value)

from_json (json_node)

get_current_value ()

get_description ()

get_id ()

get_kind ()

get_lower_bound ()

get_name ()

get_path ()

get_possible_values ()

get_read_only ()

get_scalar_increment ()

get_upper_bound ()

has_possible_value (val)

map_possible_value (key)

set_current_value (value)

set_description (description)

set_id (id)

set_kind (type)

set_lower_bound (val)

set_name (name)

set_path (path)

set_read_only (val)

set_scalar_increment (val)

set_upper_bound (val)

to_json (builder)

to_string ()

to_variant (trusted)

write_value (value)

Virtual Methods

Inherited:

GObject.Object (7)

do_write_value (value)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Fwupd.BiosSetting(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fwupd.BiosSettingClass

A BIOS setting that represents a setting in the firmware.

classmethod array_from_variant(value)[source]
Parameters:

value (GLib.Variant) – the serialized data

Returns:

attributes, or None if value was invalid.

Return type:

[Fwupd.BiosSetting]

Creates an array of new bios settings using serialized data.

New in version 1.8.4.

classmethod from_variant(value)[source]
Parameters:

value (GLib.Variant) – the serialized data

Returns:

a new Fwupd.BiosSetting, or None if value was invalid.

Return type:

Fwupd.BiosSetting

Creates a new bios setting using serialized data.

New in version 1.8.4.

classmethod new(name, path)[source]
Parameters:
  • name (str or None) – the attribute name

  • path (str or None) – the path the driver providing this attribute uses

Returns:

a new Fwupd.BiosSetting.

Return type:

Fwupd.BiosSetting

Creates a new bios setting.

New in version 1.8.4.

add_possible_value(possible_value)[source]
Parameters:

possible_value (str) – the possible

Adds a possible value to the attribute. This indicates one of the values the kernel driver will accept from userspace.

New in version 1.8.4.

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 bios setting from a JSON node.

New in version 1.8.4.

get_current_value()[source]
Returns:

the current value of the attribute.

Return type:

str

Gets the string representation of the current_value stored in an attribute from the kernel. This value is cached; so changing it outside of fwupd may may put it out of sync.

New in version 1.8.4.

get_description()[source]
Returns:

the attribute description, or None if unset.

Return type:

str

Gets the attribute description which is provided by some drivers to explain what they change.

New in version 1.8.4.

get_id()[source]
Returns:

attribute ID if set otherwise None

Return type:

str

Gets the unique attribute identifier for this attribute/driver

New in version 1.8.4.

get_kind()[source]
Returns:

the bios setting type, or Fwupd.BiosSettingKind.UNKNOWN if unset.

Return type:

Fwupd.BiosSettingKind

Gets the BIOS setting type used by the kernel interface.

New in version 1.8.4.

get_lower_bound()[source]
Returns:

guint64

Return type:

int

Gets the lower bound for integer attributes or minimum length for string attributes.

New in version 1.8.4.

get_name()[source]
Returns:

the attribute name, or None if unset.

Return type:

str

Gets the attribute name.

New in version 1.8.4.

get_path()[source]
Returns:

the driver, or None if unfound.

Return type:

str or None

Gets the path for the driver providing the attribute.

New in version 1.8.4.

get_possible_values()[source]
Returns:

all possible values.

Return type:

[str]

Find all possible values for an enumeration attribute.

New in version 1.8.4.

get_read_only()[source]
Returns:

bool

Return type:

bool

Determines if a BIOS setting is read only

New in version 1.8.4.

get_scalar_increment()[source]
Returns:

guint64

Return type:

int

Gets the scalar increment used for integer attributes.

New in version 1.8.4.

get_upper_bound()[source]
Returns:

guint64

Return type:

int

Gets the upper bound for integer attributes or maximum length for string attributes.

New in version 1.8.4.

has_possible_value(val)[source]
Parameters:

val (str) – the possible value string

Returns:

True if the self matches.

Return type:

bool

Finds out if a specific possible value was added to the attribute.

New in version 1.8.4.

map_possible_value(key)[source]
Parameters:

key (str) – the string to try to map

Raises:

GLib.Error

Returns:

the possible value that maps or None if none if found

Return type:

str

Attempts to map a user provided string into strings that a Fwupd.BiosSetting can support. The following heuristics are used:

  • Ignore case sensitivity

  • Map obviously “positive” phrases into a value that turns on the Fwupd.BiosSetting

  • Map obviously “negative” phrases into a value that turns off the Fwupd.BiosSetting

New in version 1.8.4.

set_current_value(value)[source]
Parameters:

value (str or None) – The string to set an attribute to

Sets the string stored in an attribute. This doesn’t change the representation in the kernel.

New in version 1.8.4.

set_description(description)[source]
Parameters:

description (str or None) – the attribute description

Sets the attribute description.

New in version 1.8.4.

set_id(id)[source]
Parameters:

id (str) –

Sets the unique attribute identifier for this attribute

New in version 1.8.4.

set_kind(type)[source]
Parameters:

type (Fwupd.BiosSettingKind) – a bios setting type, e.g. Fwupd.BiosSettingKind.ENUMERATION

Sets the BIOS setting type used by the kernel interface.

New in version 1.8.4.

set_lower_bound(val)[source]
Parameters:

val (int) – a guint64 value to set bound to

Sets the lower bound used for BIOS integer attributes or max length for string attributes.

New in version 1.8.4.

set_name(name)[source]
Parameters:

name (str or None) – the attribute name

Sets the attribute name provided by a kernel driver.

New in version 1.8.4.

set_path(path)[source]
Parameters:

path (str or None) – the path the driver providing the attribute uses

Sets path to the attribute.

New in version 1.8.4.

set_read_only(val)[source]
Parameters:

val (bool) –

Configures whether an attribute is read only maximum length for string attributes.

New in version 1.8.4.

set_scalar_increment(val)[source]
Parameters:

val (int) – a guint64 value to set increment to

Sets the scalar increment used for BIOS integer attributes.

New in version 1.8.4.

set_upper_bound(val)[source]
Parameters:

val (int) – a guint64 value to set bound to

Sets the upper bound used for BIOS integer attributes or max length for string attributes.

New in version 1.8.4.

to_json(builder)[source]
Parameters:

builder (Json.Builder) – a JSON builder

Adds a fwupd bios setting to a JSON builder.

New in version 1.8.4.

to_string()[source]
Returns:

text, or None for invalid

Return type:

str

Builds a text representation of the object.

New in version 1.8.4.

to_variant(trusted)[source]
Parameters:

trusted (bool) – whether the caller should receive trusted values

Returns:

the serialized data, or None for error.

Return type:

GLib.Variant

Serialize the bios setting.

New in version 1.8.4.

write_value(value)[source]
Parameters:

value (str) – The string to write

Raises:

GLib.Error

Returns:

True for success

Return type:

bool

Writes a new value into the setting if it is different from the current value.

NOTE: A subclass should handle the ->write_value() vfunc and actually write the value to the firmware.

New in version 1.9.4.

do_write_value(value) virtual
Parameters:

value (str) – The string to write

Returns:

True for success

Return type:

bool

Writes a new value into the setting if it is different from the current value.

NOTE: A subclass should handle the ->write_value() vfunc and actually write the value to the firmware.

New in version 1.9.4.