Colord.Sensor¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r |
|||
r/w/c |
|||
r |
|||
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
|---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
|---|---|---|---|
parent_instance |
r |
Class Details¶
- class Colord.Sensor(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod cap_from_string(sensor_cap)[source]¶
- Parameters:
sensor_cap (
str) – the sensor capability, e.g. ‘projector’.- Returns:
- Return type:
Gets the sensor capability as a enumerated value.
- classmethod cap_to_string(sensor_cap)[source]¶
- Parameters:
sensor_cap (
Colord.SensorCap) – aColord.SensorCap- Returns:
the sensor capability, e.g. ‘projector’.
- Return type:
Gets the sensor capability as a string.
- classmethod error_from_string(error_desc)[source]¶
- Parameters:
error_desc (
str) –- Returns:
enumerated value
- Return type:
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:
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:
- Return type:
Gets the sensor kind as a enumerated value.
- classmethod kind_to_string(sensor_kind)[source]¶
- Parameters:
sensor_kind (
Colord.SensorKind) – aColord.SensorKind- Returns:
the sensor kind, e.g. ‘huey’.
- Return type:
Gets the sensor kind as a string.
- classmethod new()[source]¶
- Returns:
a new
Colord.Sensorobject.- Return type:
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:
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:
- Return type:
Gets the sensor stateability as a enumerated value.
- classmethod state_to_string(sensor_state)[source]¶
- Parameters:
sensor_state (
Colord.SensorState) – aColord.SensorState- Returns:
the sensor stateability, e.g. ‘measuring’.
- Return type:
Gets the sensor stateability as a string.
- connect(cancellable, callback, *user_data)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Connects to the sensor.
New in version 0.1.8.
- connect_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
Trueif we could connect to to the sensor- Return type:
Gets the result from the asynchronous function.
New in version 0.1.8.
- connect_sync(cancellable)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNone- Raises:
- Returns:
- Return type:
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) – anotherColord.Sensorinstance.- Returns:
Trueif the sensors are the same device- Return type:
Tests two sensors for equality.
New in version 0.1.8.
- get_caps()[source]¶
- Returns:
The sensor capability bitfield.
- Return type:
Returns the sensor metadata.
New in version 0.1.6.
- get_metadata_item(key)[source]¶
- Parameters:
key (
str) – a key for the metadata dictionary- Returns:
the metadata value, or
Noneif not set.- Return type:
Returns the sensor metadata for a specific key.
New in version 0.1.28.
- get_option(key)[source]¶
- Parameters:
key (
str) – a key to search for.- Returns:
A const string, or
Noneof not found.- Return type:
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.SensorCapcancellable (
Gio.CancellableorNone) – aGio.Cancellable, orNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Gets a color sample from a sensor
New in version 0.1.8.
- get_sample_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
the XYZ reading, or
None- Return type:
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.
- get_spectrum(cap, cancellable, callback, *user_data)[source]¶
- Parameters:
cap (
Colord.SensorCap) – aColord.SensorCapcancellable (
Gio.CancellableorNone) – aGio.Cancellable, orNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Gets a color spectrum from a sensor
New in version 1.3.1.
- get_spectrum_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
the XYZ reading, or
None- Return type:
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.
- 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:
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, orNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Locks the device so we can use it.
New in version 0.1.8.
- lock_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
success
- Return type:
Gets the result from the asynchronous function.
New in version 0.1.8.
- lock_sync(cancellable)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNone- Raises:
- Returns:
- Return type:
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 optionscancellable (
Gio.CancellableorNone) – aGio.Cancellable, orNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Sets options on the sensor device.
New in version 0.1.20.
- set_options_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
success
- Return type:
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 optionscancellable (
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.
- unlock(cancellable, callback, *user_data)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.Cancellable, orNonecallback (
Gio.AsyncReadyCallbackorNone) – the function to run on completion
Unlocks the sensor for use by other programs.
New in version 0.1.8.
- unlock_finish(res)[source]¶
- Parameters:
res (
Gio.AsyncResult) – theGio.AsyncResult- Raises:
- Returns:
success
- Return type:
Gets the result from the asynchronous function.
New in version 0.1.8.
- unlock_sync(cancellable)[source]¶
- Parameters:
cancellable (
Gio.CancellableorNone) – aGio.CancellableorNone- Raises:
- Returns:
- Return type:
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.
- do_button_pressed() virtual¶
Signal Details¶
- Colord.Sensor.signals.button_pressed(sensor)¶
- Signal Name:
button-pressed- Flags:
- 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¶
-
The if the object path has been connected as is valid for use.
New in version 0.1.9.
- Colord.Sensor.props.embedded¶
-
If the sensor has a native driver.
New in version 0.1.26.
- Colord.Sensor.props.id¶
-
The object ID of the remote object
New in version 0.1.26.
- Colord.Sensor.props.kind¶
-
The sensor kind.
New in version 0.1.6.
- Colord.Sensor.props.locked¶
-
If the sensor is locked.
New in version 0.1.6.
- Colord.Sensor.props.mode¶
-
The sensor mode.
New in version 0.1.6.
- Colord.Sensor.props.model¶
-
The sensor model.
New in version 0.1.6.
- Colord.Sensor.props.native¶
-
If the sensor has a native driver.
New in version 0.1.6.
- Colord.Sensor.props.object_path¶
-
The object path of the remote object
New in version 0.1.8.
- Colord.Sensor.props.serial¶
-
The sensor ID.
New in version 0.1.6.
- Colord.Sensor.props.state¶
-
The sensor state.
New in version 0.1.6.