Please Assist with UI Action

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
autobear
Posts: 6
Joined: 16 Oct 2015 07:22

Please Assist with UI Action

Post by autobear » 18 Oct 2015 15:11

Two Questions:

1. Inside Action UI - please give an example how does the isChecked(variable) work - does it give a Boolean true or false output and into what variable ?

2. I'm trying to check if Power saving is enabled in QuickSettings - can I use isChecked for this ?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Please Assist with UI Action

Post by Martin » 19 Oct 2015 18:56

Hi,

Quick settings are often not real toggle buttons or check boxes that can be queried with function isChecked. Please try to see if this power saving toggle is part of the system settings. To do this, create an action Init Variable System Setting and scroll through the list of available settings to see if one could be the power saving toggle (for Samsung devices it might be powersaving_switch or psm_switch). Toggle the setting on/off and verify if the system settings value changes. If yes, you can query the value and store the current value in a variable of your choice.
Use a condition Expression: setting=="1" to check if the setting is turned on.

The power saving mode of the Google-Android 5+ can be checked with condition Battery Saver Mode Enabled.

Regards,
Martin

Post Reply