status
Look up status.set, which sets an alarm, a warning, or a state from an Arc automation.
The status module sets statuses, such as alarms and warnings, that the Console shows.
Import it with import status.
set
Updates the status with a matching key or name. When no status matches, status.set
creates one with that name.
key_or_namestr = ""The key or the name of the status. An empty value fails when it runs.
messagestr = ""The message that the status shows.
variantstr = ""success,info,warning,error,loading, ordisabled. An empty value fails when it runs.
- Input -> optional. Trigger-only: each new input value runs it, whatever the value. To
run it only when a condition is true, use
=>. With no input, it runs once each time its stage starts. - Output -> the key of the status, as a
str. A failed call gives an empty key. - Function form ->
status.set(key_or_name, message, variant) str.
Synnax looks for a status with the key first, then for one with the name. When more than
one status has the name, it updates the first one and shows a warning. A new status gets
a new key. The compiler checks a literal variant. A call that fails at run time shows
a warning, and the automation keeps running.
import status
tank_pt > 500 => status.set{
key_or_name="tank_overpressure",
message="Tank pressure above 500 psi",
variant="error",
}The example sets the status on each tank_pt value above 500. status.set works the
same on the Core and on a Driver.