Changes

no edit summary
Line 1: Line 1: −
Constraints are optional and can be used to allow or prevent a macro/action from running based on certain conditions.
+
<span style="color: #0E9549;">'''What is a constraint?'''</span>
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
Constraints in MacroDroid are optional tools that allow you to control when a macro or a specific action is triggered. They are based on certain conditions that must be met to allow or prevent the execution of macros and actions.
 +
</pre>
   −
Constraints can be placed on macros to allow or prevent the entire macro firing based on the set condition(s). You can also add constraints directly to individual triggers and actions from the 'Edit Macro' screen, by clicking on the trigger/action and selecting "Add constraint"
+
<span style="color: #0E9549;">'''Apply to entire macros:'''</span>
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
You can apply constraints to an entire macro (at the bottom of the 'Constraints' tab).
   −
A constraint is evaluated at the point a trigger fires or action runs and a macro/action will only run if the <strong>constraint condition is true.</strong>
+
This means that the macro will only be activated if the conditions set by the constraints are met.
 +
</pre>
 +
<span style="color: #0E9549;">'''Restrictions on Triggers and Individual Actions:'''</span>
 +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
As well as being applied to an entire macro, constraints can be added directly to individual triggers and actions.
   −
By default if adding more than one constraint to a macro they will be combined with an AND condition (e.g. all added constraints must be true). This can be changed in the dropdown in the constraints title to an OR condition. In this case only one of the added constraints needs to be true for the macro to run.
+
This is done from the 'Edit Macro' screen by selecting the trigger or action and selecting 'Add Constraint'.
 +
</pre>
 +
<span style="color: #0E9549;">'''Nesting constraints'''</span>
   −
<strong>Nesting constraints</strong>
+
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 +
If you need more sophisticated logic applied to constraint there is a special AND/OR/XOR/NOT constraint that can be used.
   −
If you need more sophisticated logic applied to constraint there is a special AND/OR/XOR/NOT constraint that can be used. Any constraints nested under the logic constraint will have that logic operator applied. It's also possible to nest multiple logic constraints to create complex logic. For example:
+
Any constraints nested under the logic constraint will have that logic operator applied. It's also possible to nest multiple logic constraints to create complex logic.
 +
For example:
 +
</pre>
    +
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
  AND
 
  AND
 
   | - Constraint 1
 
   | - Constraint 1
Line 16: Line 31:  
       | - Constraint 2
 
       | - Constraint 2
 
       | - Constraint 3
 
       | - Constraint 3
 
+
</pre>
 
In the above example, Constraint 1 must always be true '''AND''' at least one of (Constraint 2 '''OR''' Constraint 3) must be true.
 
In the above example, Constraint 1 must always be true '''AND''' at least one of (Constraint 2 '''OR''' Constraint 3) must be true.
  
editors
1,590

edits