ExampleDevice

To import ExampleDevice, you can either use:

from psychopy_plugin_template.hardware.exampleDevice import ExampleDevice
or, any time after psychopy.plugins.activatePlugins has been called::

from psychopy.hardware import ExampleDevice

class psychopy_plugin_template.hardware.exampleDevice.ExampleDevice[source]

Blank hardware object showcase how to make a new type of hardware object. If the hardware in question is a response device, such as a button box, you should check out the docs for [ExampleResponseDevice][psychopy_plugin_template.hardware.exampleResponseDevice.ExampleResponseDevice] instead.

Should be deleted before publishing your plugin.

static getAvailableDevices()

Get all available devices of this type.

Returns:

List of dictionaries containing the parameters needed to initialise each device.

Return type:

list[dict]

getDeviceProfile()

Generate a dictionary describing this device by finding the profile from getAvailableDevices which represents the same physical device as this object.

Returns:

Dictionary representing this device

Return type:

dict

getJSON(asString=True)

Convert the output of getDeviceProfile to a JSON string.

Parameters:

asString (bool) – If True, then the output will be converted to a string, otherwise will simply be a JSON-friendly dict.

Returns:

JSON string (or JSON friendly dict) of getDeviceProfile.

Return type:

str or dict

isSameDevice(other)

Determine whether this object represents the same physical device as a given other object.

Parameters:

other (BaseDevice, dict) – Other device object to compare against, or a dict of params.

Returns:

True if the two objects represent the same physical device

Return type:

bool


Back to top