| Line 1: |
Line 1: |
| | <pre class="header-style"> | | <pre class="header-style"> |
| − | When the battery % increases or decreases, this trigger will fire. The trigger can be configured to trigger on any change or when the battery % increases or decreases to a certain level.</pre>
| + | This trigger fires when the device's Airplane mode setting is changed. You can configure it to trigger when Airplane mode is enabled, or when it is disabled. |
| − | '''HINT:'''<br/>
| + | </pre> |
| − | Don't forget that a trigger fires once at the exact time the event occurs. So, in the below examples, it will only fire when battery level goes down from 21% to 20% or up from 29% to 30%.<br/>
| |
| − | <br>
| |
| − | '''Example Usage #1:'''<br/>
| |
| − | If the battery level decreases to 20% lower the screen brightness.
| |
| − | <pre class="trigger-style">
| |
| − | Triggers
| |
| | | | |
| − | Battery (<=20%)</pre>
| + | ''' Options ''' |
| − | <pre class="action-style">
| |
| − | Actions
| |
| | | | |
| − | Screen Brightness 25%
| + | When configuring this trigger, select one of the following: |
| − | </pre> | + | |
| | + | * '''Airplane Mode Enabled''' - Fires when Airplane mode is turned ON |
| | + | * '''Airplane Mode Disabled''' - Fires when Airplane mode is turned OFF |
| | + | |
| | + | ''' How It Works ''' |
| | + | |
| | + | The trigger listens for the system broadcast that Android sends whenever the Airplane mode state changes. This means the trigger fires immediately when the setting is toggled, regardless of how it was changed (Quick Settings tile, Settings app, or another automation). |
| | + | |
| | + | ''' Example 1: Mute media when going to sleep ''' |
| | + | |
| | + | When Airplane mode is enabled at night, automatically mute media volume. |
| | + | |
| | + | <pre class="trigger-style">Trigger: Airplane Mode Enabled</pre> |
| | + | <pre class="action-style">Action: Volume Change - Media Volume = 0</pre> |
| | + | <pre class="constraint-style">Constraint: Time of Day (10:00 PM - 7:00 AM)</pre> |
| | + | |
| | + | ''' Example 2: Restore connectivity settings after flight ''' |
| | + | |
| | + | When Airplane mode is disabled, automatically enable Wi-Fi and Bluetooth. |
| | + | |
| | + | <pre class="trigger-style">Trigger: Airplane Mode Disabled</pre> |
| | + | <pre class="action-style">Action: Set Wi-Fi State - Enable Wi-Fi</pre> |
| | + | <pre class="action-style">Action: Set Bluetooth State - Enable Bluetooth</pre> |
| | + | |
| | + | ''' Example 3: Log flight times ''' |
| | + | |
| | + | Track when you enable Airplane mode (boarding a flight) by logging to a file. |
| | + | |
| | + | <pre class="trigger-style">Trigger: Airplane Mode Enabled</pre> |
| | + | <pre class="action-style">Action: Write To File - Append "[date_time] - Flight mode started" to flight_log.txt</pre> |
| | + | |
| | + | ''' Notes ''' |
| | | | |
| − | <br>
| + | * This trigger detects '''changes''' to Airplane mode. It does not fire based on the current state when a macro is enabled. To check the current Airplane mode state, use the [[Constraint:_Airplane_Mode|Airplane Mode Constraint]]. |
| − | '''Example Usage #2:'''<br/> | + | * On some devices, enabling Airplane mode automatically disables Wi-Fi, Bluetooth, and mobile data. However, some devices allow Wi-Fi and Bluetooth to be re-enabled while Airplane mode remains active. |
| − | If the battery level increases to 30% increase the screen brightness.
| + | * No special permissions are required for this trigger. |
| − | <pre class="trigger-style">
| |
| − | Triggers
| |
| | | | |
| − | Battery (>=30%)
| + | ''' See Also ''' |
| − | </pre>
| |
| − | <pre class="action-style">
| |
| − | Actions
| |
| | | | |
| − | Screen Brightness 75%
| + | * [[Constraint:_Airplane_Mode|Airplane Mode Constraint]] - Check if Airplane mode is currently enabled/disabled |
| − | </pre>
| + | * [[Action:_Set_Airplane_Mode|Set Airplane Mode Action]] - Enable or disable Airplane mode |
| | | | |
| − | </pre><br>
| + | [[Category:Triggers]] |