Colord.Sensor¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | cap_from_string(sensor_cap) | 
| class | cap_to_string(sensor_cap) | 
| class | error_from_string(error_desc) | 
| class | error_quark() | 
| class | error_to_string(error_enum) | 
| class | kind_from_string(sensor_kind) | 
| class | kind_to_string(sensor_kind) | 
| class | new() | 
| class | new_with_object_path(object_path) | 
| class | state_from_string(sensor_state) | 
| class | state_to_string(sensor_state) | 
| connect(cancellable, callback, *user_data) | |
| connect_finish(res) | |
| connect_sync(cancellable) | |
| equal(sensor2) | |
| get_caps() | |
| get_connected() | |
| get_embedded() | |
| get_id() | |
| get_kind() | |
| get_locked() | |
| get_metadata() | |
| get_metadata_item(key) | |
| get_mode() | |
| get_model() | |
| get_native() | |
| get_object_path() | |
| get_option(key) | |
| get_options() | |
| get_sample(cap, cancellable, callback, *user_data) | |
| get_sample_finish(res) | |
| get_sample_sync(cap, cancellable) | |
| get_serial() | |
| get_spectrum(cap, cancellable, callback, *user_data) | |
| get_spectrum_finish(res) | |
| get_spectrum_sync(cap, cancellable) | |
| get_state() | |
| get_vendor() | |
| has_cap(cap) | |
| lock(cancellable, callback, *user_data) | |
| lock_finish(res) | |
| lock_sync(cancellable) | |
| set_object_path(object_path) | |
| set_options(values, cancellable, callback, *user_data) | |
| set_options_finish(res) | |
| set_options_sync(values, cancellable) | |
| to_string() | |
| unlock(cancellable, callback, *user_data) | |
| unlock_finish(res) | |
| unlock_sync(cancellable) | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| connected | str | r | |
| embedded | str | r | |
| id | str | r | |
| kind | str | r | |
| locked | str | r | |
| mode | str | r | |
| model | str | r | |
| native | str | r | |
| object-path | str | r/w/c | |
| serial | str | r | |
| state | str | r | |
| vendor | str | r | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| button-pressed | The ::button-pressedsignal is emitted when the button has been pressed. | 
Class Details¶
- 
class Colord.Sensor(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Colord.SensorClass- 
classmethod cap_from_string(sensor_cap)[source]¶
- Parameters: - sensor_cap ( - str) – the sensor capability, e.g. ‘projector’.- Returns: - a - Colord.SensorCap- Return type: - Colord.SensorCap- Gets the sensor capability as a enumerated value. 
 - 
classmethod cap_to_string(sensor_cap)[source]¶
- Parameters: - sensor_cap ( - Colord.SensorCap) – a- Colord.SensorCap- Returns: - the sensor capability, e.g. ‘projector’. - Return type: - str- Gets the sensor capability as a string. 
 - 
classmethod error_from_string(error_desc)[source]¶
- Parameters: - error_desc ( - str) –- Returns: - enumerated value - Return type: - Colord.SensorError- Converts a string to a - Colord.SensorError.- New in version 0.1.26. 
 - 
classmethod error_to_string(error_enum)[source]¶
- Parameters: - error_enum ( - Colord.SensorError) –- Returns: - identifier string - Return type: - str- Converts a - Colord.SensorErrorto a string.- New in version 0.1.26. 
 - 
classmethod kind_from_string(sensor_kind)[source]¶
- Parameters: - sensor_kind ( - str) – the sensor kind, e.g. ‘huey’.- Returns: - a - Colord.SensorKind- Return type: - Colord.SensorKind- Gets the sensor kind as a enumerated value. 
 - 
classmethod kind_to_string(sensor_kind)[source]¶
- Parameters: - sensor_kind ( - Colord.SensorKind) – a- Colord.SensorKind- Returns: - the sensor kind, e.g. ‘huey’. - Return type: - str- Gets the sensor kind as a string. 
 - 
classmethod new()[source]¶
- Returns: - a new - Colord.Sensorobject.- Return type: - Colord.Sensor- Creates a new - Colord.Sensorobject.- New in version 0.1.6. 
 - 
classmethod new_with_object_path(object_path)[source]¶
- Parameters: - object_path ( - str) – The colord object path.- Returns: - a new sensor object. - Return type: - Colord.Sensor- Creates a new - Colord.Sensorobject with a known object path.- New in version 0.1.8. 
 - 
classmethod state_from_string(sensor_state)[source]¶
- Parameters: - sensor_state ( - str) – the sensor stateability, e.g. ‘measuring’.- Returns: - a - Colord.SensorState- Return type: - Colord.SensorState- Gets the sensor stateability as a enumerated value. 
 - 
classmethod state_to_string(sensor_state)[source]¶
- Parameters: - sensor_state ( - Colord.SensorState) – a- Colord.SensorState- Returns: - the sensor stateability, e.g. ‘measuring’. - Return type: - str- Gets the sensor stateability as a string. 
 - 
connect(cancellable, callback, *user_data)[source]¶
- Parameters: - cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Connects to the sensor. - New in version 0.1.8. 
- cancellable (
 - 
connect_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - Trueif we could connect to to the sensor- Return type: - bool- Gets the result from the asynchronous function. - New in version 0.1.8. 
 - 
connect_sync(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellableor- None- Raises: - GLib.Error- Returns: - Truefor success, else- False.- Return type: - bool- Connects to the object and fills up initial properties. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 0.1.8. 
 - 
equal(sensor2)[source]¶
- Parameters: - sensor2 ( - Colord.Sensor) – another- Colord.Sensorinstance.- Returns: - Trueif the sensors are the same device- Return type: - bool- Tests two sensors for equality. - New in version 0.1.8. 
 - 
get_caps()[source]¶
- Returns: - The sensor capability bitfield. - Return type: - int- Returns the sensor metadata. - New in version 0.1.6. 
 - 
get_connected()[source]¶
- Returns: - Trueif properties are valid- Return type: - bool- Gets if the sensor has been connected. - New in version 0.1.9. 
 - 
get_embedded()[source]¶
- Returns: - Trueif embedded.- Return type: - bool- Returns if the sensor is embedded into the computer. - New in version 0.1.26. 
 - 
get_id()[source]¶
- Returns: - the object ID, or - None- Return type: - str- Gets the object ID for the sensor. - New in version 0.1.26. 
 - 
get_kind()[source]¶
- Returns: - A - Colord.SensorKind, e.g.- Colord.SensorKind.HUEY- Return type: - Colord.SensorKind- Gets the sensor kind. - New in version 0.1.6. 
 - 
get_locked()[source]¶
- Returns: - Trueif VCGT is valid.- Return type: - bool- Returns if the sensor is locked. - New in version 0.1.6. 
 - 
get_metadata()[source]¶
- Returns: - a - GLib.HashTable.- Return type: - { - str:- str}- Returns the sensor metadata. - New in version 0.1.28. 
 - 
get_metadata_item(key)[source]¶
- Parameters: - key ( - str) – a key for the metadata dictionary- Returns: - the metadata value, or - Noneif not set.- Return type: - str- Returns the sensor metadata for a specific key. - New in version 0.1.28. 
 - 
get_mode()[source]¶
- Returns: - A - Colord.SensorCap, e.g.- Colord.SensorCap.AMBIENT- Return type: - Colord.SensorCap- Gets the sensor operating mode. - New in version 0.1.6. 
 - 
get_model()[source]¶
- Returns: - A string, or - Nonefor invalid- Return type: - str- Gets the sensor model. - New in version 0.1.6. 
 - 
get_native()[source]¶
- Returns: - Trueif VCGT is valid.- Return type: - bool- Returns if the sensor has a native driver. - New in version 0.1.6. 
 - 
get_object_path()[source]¶
- Returns: - the object path, or - None- Return type: - str- Gets the object path for the sensor. - New in version 0.1.6. 
 - 
get_option(key)[source]¶
- Parameters: - key ( - str) – a key to search for.- Returns: - A const string, or - Noneof not found.- Return type: - str- Gets a specific sensor option. - New in version 0.1.20. 
 - 
get_options()[source]¶
- Returns: - A refcounted - GLib.HashTableof (string,- GLib.Variant).- Return type: - { - str:- GLib.Variant}- Gets any sensor options. - New in version 0.1.20. 
 - 
get_sample(cap, cancellable, callback, *user_data)[source]¶
- Parameters: - cap (Colord.SensorCap) – aColord.SensorCap
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Gets a color sample from a sensor - New in version 0.1.8. 
- cap (
 - 
get_sample_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - the XYZ reading, or - None- Return type: - Colord.ColorXYZ- Gets the result from the asynchronous function. - New in version 0.1.8. 
 - 
get_sample_sync(cap, cancellable)[source]¶
- Parameters: - cap (Colord.SensorCap) – The device capability, e.g.Colord.SensorCap.AMBIENT.
- cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
 - Raises: - Returns: - the XYZ reading, with ambient levels in Lux encoded in X, or - Nonefor error.- Return type: - Gets a sample from the sensor. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 0.1.8. 
- cap (
 - 
get_serial()[source]¶
- Returns: - A string, or - Nonefor invalid- Return type: - str- Gets the sensor serial number. - New in version 0.1.6. 
 - 
get_spectrum(cap, cancellable, callback, *user_data)[source]¶
- Parameters: - cap (Colord.SensorCap) – aColord.SensorCap
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Gets a color spectrum from a sensor - New in version 1.3.1. 
- cap (
 - 
get_spectrum_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - the XYZ reading, or - None- Return type: - Colord.Spectrum- Gets the result from the asynchronous function. - New in version 1.3.1. 
 - 
get_spectrum_sync(cap, cancellable)[source]¶
- Parameters: - cap (Colord.SensorCap) – The device capability, e.g.Colord.SensorCap.AMBIENT.
- cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
 - Raises: - Returns: - the XYZ reading, with ambient levels in Lux encoded in X, or - Nonefor error.- Return type: - Gets a spectrum from the sensor. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 1.3.1. 
- cap (
 - 
get_state()[source]¶
- Returns: - A - Colord.SensorState, e.g.- Colord.SensorState.IDLE- Return type: - Colord.SensorState- Gets the sensor state. - New in version 0.1.6. 
 - 
get_vendor()[source]¶
- Returns: - A string, or - Nonefor invalid- Return type: - str- Gets the sensor vendor. - New in version 0.1.6. 
 - 
has_cap(cap)[source]¶
- Parameters: - cap ( - Colord.SensorCap) – a specified capability, e.g.- Colord.SensorCap.LCD- Returns: - Trueif the sensor has the specified capability- Return type: - bool- Returns the sensor metadata for a specific key. - New in version 0.1.6. 
 - 
lock(cancellable, callback, *user_data)[source]¶
- Parameters: - cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Locks the device so we can use it. - New in version 0.1.8. 
- cancellable (
 - 
lock_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - success - Return type: - bool- Gets the result from the asynchronous function. - New in version 0.1.8. 
 - 
lock_sync(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellableor- None- Raises: - GLib.Error- Returns: - Truefor success, else- False.- Return type: - bool- Locks the device so we can use it. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 0.1.6. 
 - 
set_object_path(object_path)[source]¶
- Parameters: - object_path ( - str) – The colord object path.- Sets the object path of the sensor. - New in version 0.1.8. 
 - 
set_options(values, cancellable, callback, *user_data)[source]¶
- Parameters: - values ({str:GLib.Variant}) – the options
- cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Sets options on the sensor device. - New in version 0.1.20. 
- values ({
 - 
set_options_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - success - Return type: - bool- Gets the result from the asynchronous function. - New in version 0.1.20. 
 - 
set_options_sync(values, cancellable)[source]¶
- Parameters: - values ({str:GLib.Variant}) – the options
- cancellable (Gio.CancellableorNone) – aGio.CancellableorNone
 - Raises: - Returns: - Return type: - Sets options on the sensor device. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 0.1.20. 
- values ({
 - 
unlock(cancellable, callback, *user_data)[source]¶
- Parameters: - cancellable (Gio.CancellableorNone) – aGio.Cancellable, orNone
- callback (Gio.AsyncReadyCallbackorNone) – the function to run on completion
- user_data (objectorNone) – the data to pass to callback
 - Unlocks the sensor for use by other programs. - New in version 0.1.8. 
- cancellable (
 - 
unlock_finish(res)[source]¶
- Parameters: - res ( - Gio.AsyncResult) – the- Gio.AsyncResult- Raises: - GLib.Error- Returns: - success - Return type: - bool- Gets the result from the asynchronous function. - New in version 0.1.8. 
 - 
unlock_sync(cancellable)[source]¶
- Parameters: - cancellable ( - Gio.Cancellableor- None) – a- Gio.Cancellableor- None- Raises: - GLib.Error- Returns: - Truefor success, else- False.- Return type: - bool- Unlocks the device for use by other programs. - WARNING: This function is synchronous, and may block. Do not use it in GUI applications. - New in version 0.1.6. 
 
- 
classmethod 
Signal Details¶
- Signal Name: - button-pressed- Flags: - RUN_LAST- Parameters: - sensor ( - Colord.Sensor) – The object which received the signal- The - ::button-pressedsignal is emitted when the button has been pressed.- New in version 0.1.6. 
Property Details¶
- 
Colord.Sensor.props.connected¶
- Name: - connected- Type: - str- Default Value: - None- Flags: - READABLE- The if the object path has been connected as is valid for use. - New in version 0.1.9. 
- 
Colord.Sensor.props.embedded¶
- Name: - embedded- Type: - str- Default Value: - None- Flags: - READABLE- If the sensor has a native driver. - New in version 0.1.26. 
- 
Colord.Sensor.props.id¶
- Name: - id- Type: - str- Default Value: - None- Flags: - READABLE- The object ID of the remote object - New in version 0.1.26. 
- 
Colord.Sensor.props.kind¶
- Name: - kind- Type: - str- Default Value: - None- Flags: - READABLE- The sensor kind. - New in version 0.1.6. 
- 
Colord.Sensor.props.locked¶
- Name: - locked- Type: - str- Default Value: - None- Flags: - READABLE- If the sensor is locked. - New in version 0.1.6. 
- 
Colord.Sensor.props.mode¶
- Name: - mode- Type: - str- Default Value: - None- Flags: - READABLE- The sensor mode. - New in version 0.1.6. 
- 
Colord.Sensor.props.model¶
- Name: - model- Type: - str- Default Value: - None- Flags: - READABLE- The sensor model. - New in version 0.1.6. 
- 
Colord.Sensor.props.native¶
- Name: - native- Type: - str- Default Value: - None- Flags: - READABLE- If the sensor has a native driver. - New in version 0.1.6. 
- 
Colord.Sensor.props.object_path¶
- Name: - object-path- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT- The object path of the remote object - New in version 0.1.8. 
- 
Colord.Sensor.props.serial¶
- Name: - serial- Type: - str- Default Value: - None- Flags: - READABLE- The sensor ID. - New in version 0.1.6.