Flag A flag
A named on/off switch that exists only inside TRAX Control. Scripts and rules can set it and ask it. After TRAX Control restarts it is off.
What for: To share a state between scripts and rules, such as 'night' or 'maintenance': a script sets the flag, a rule asks it as a condition.
flag("night").on()
if (flag("night").isOn()) { log "it is night" }Methods
on
Sets it.
Sets the flag on.
flag("night").on()off
Clears it.
Sets the flag off.
flag("night").off()isOn → boolean
Whether it is set.
Whether the flag is on. Also as a property: flag("night").on.
if (flag("night").isOn()) log "night"