API Reference v9.2.0

Triggersclass

Module: ZaberMotionAscii

Class providing access to device triggers. Please note that the Triggers API is currently an experimental feature. Requires at least Firmware 7.06.

The following example illustrates how you can obtain an instance of this type:

import ZaberMotionAscii

let connection = try await Connection.openSerialPort(portName: "COM3")
let device = try connection.getDevice(deviceAddress: 1)
let triggers = device.triggers
Related Guides:

Properties

p

device

readonly
triggers.device
Device Device that these triggers belong to.

Methods

m

getAllLabels()

asyncthrows
try await triggers.getAllLabels()
Gets the labels for every trigger for this device.
Return Value
[String] The labels for every trigger for this device. If a trigger has no label, the value will be an empty string.
m

getEnabledStates()

asyncthrows
try await triggers.getEnabledStates()
Gets the enabled state for every trigger for this device.
Return Value
[TriggerEnabledState] Whether triggers are enabled and the number of times they will fire.
m

getNumberOfActions()

asyncthrows
try await triggers.getNumberOfActions()
Get the number of actions for each trigger for this device.
Return Value
Int Number of actions for each trigger for this device.
m

getNumberOfTriggers()

asyncthrows
try await triggers.getNumberOfTriggers()
Get the number of triggers for this device.
Return Value
Int Number of triggers for this device.
m

getTrigger()

throws
try triggers.getTrigger(triggerNumber)
Get a specific trigger for this device.
Arguments
NameTypeDescription
triggerNumberIntThe number of the trigger to control. Trigger numbers start at 1.
Return Value
Trigger Trigger instance.
m

getTriggerStates()

asyncthrows
try await triggers.getTriggerStates()
Get the state for every trigger for this device.
Return Value
[TriggerState] Complete state for every trigger.