blockmode variable

Post your questions and help other users.

Moderator: Martin

Post Reply
xeenon
Posts: 7
Joined: 21 Jul 2014 09:12

blockmode variable

Post by xeenon » 21 Jul 2014 09:34

hi

my native language is German. sorry for my English.

how can I set a variable (1) if the blockmode goes active?

best regards

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

Re: blockmode variable

Post by Martin » 21 Jul 2014 16:24

Hi,

Do you mean the Samsung specific blocking mode?

You could use a trigger System Setting Changed: System dormant_switch_onoff (should be available for the S3 and also the S5 but might have been named differently on other Samsung devices). The trigger makes the value available in variable setting. You could assign the value to your own global variable.
For example like this:
-trigger System Setting Changed: System dormant_switch_onoff
-action Script: global_blocking_mode = setting;

The value of the variable will be 0 for off resp. 1 for on.

You could also use an action Init Variable System Setting: System dormant_switch_onoff to blocking_mode to access the current value of Androids system settings database at the time when you want to use the value.

Regards,
Martin

xeenon
Posts: 7
Joined: 21 Jul 2014 09:12

Re: blockmode variable

Post by xeenon » 21 Jul 2014 17:25

no, I mean the "ruhemodus", it means quiet hours. it was my fault. I use a nexus5.

I found a value called quiet_hours_active

I don't know how I can use this to set a global variable.

what I want to do: in a flow I want to set the variable global_qh to 1 if the quiet hours goes active and set it to 0 If it goes inactive.

in an another flow I need the variable as condition. but I don't I how I can use this. I tried to set this globalvariable manualy.

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

Re: blockmode variable

Post by Martin » 21 Jul 2014 17:47

What kind of ROM are you using? I did not find this setting on my Nexus 5 (stock Android).

You can use almost the same flow to set a global variable to 0 or 1:
-trigger System Setting Changed: System quiet_hours_active
-action Script: global_ruhemodus = setting;

The trigger System Setting Changed executes the flow whenever it detects a change in the system database. The trigger also provides a variable setting that contains the current value which is usually a 0 when a setting is turned off or a 1 when the setting is turned on. Please also check out the documentation provided for each trigger by pressing the [?]-button when you are editing a trigger. The help lists all variables that a trigger provides to the flow.
You can also add a condition Debug Dialog to show a dialog that contains all global and local variables including the value of each variable at the time when the dialog-condition is executed.

xeenon
Posts: 7
Joined: 21 Jul 2014 09:12

Re: blockmode variable

Post by xeenon » 21 Jul 2014 19:56

iam using omnirom.

sorry, I don't understand your post. maybe a user can translate it into German.

xeenon
Posts: 7
Joined: 21 Jul 2014 09:12

Re: blockmode variable

Post by xeenon » 22 Jul 2014 10:05

it works now. thanks for your help.


but what I don't understand the debug part anyway.

Post Reply