Which variable?
Moderator: Martin
-
- Posts: 18
- Joined: 07 Dec 2013 05:59
Which variable?
Which variable can be used to get brightness level?
And how can it be triggered?
And how can it be triggered?
Re: Which variable?
What to you want to do in your flow? There's a trigger light sensor and an action set screen brightness.
Re: Which variable?
I am guessing that he means the equivalent to "store audio volumes", just for brightness. I was also looking for that action, but couldn´t find it.
When you use a flow to adjust the brightness it would be nice if you could revert it to the old settings afterwards (as you can do with volume levels).
But maybe that´s not what apshergill91 meant, so some more information on what you are planning on doing with your flow would be helpful.
When you use a flow to adjust the brightness it would be nice if you could revert it to the old settings afterwards (as you can do with volume levels).
But maybe that´s not what apshergill91 meant, so some more information on what you are planning on doing with your flow would be helpful.
Re: Which variable?
Init system setting action should work. I don't know the setting name, but search for something related to brightness. Value is propably between 0 and 100 or 0 and 255.
Re: Which variable?
I have had a look into init system settings / set system settings, but I ended up with some wierd behaviour. I have a Galaxy S4, which can switch between manual and automatic brightness control, each with it´s own brightness setting.
So there are three variables that I need: Manual brightness level, automatic brightness level and the brightness level mode (auto or manual).
I went through the list of system settings and found three variables, which change their values according to my current settings, so I am quite sure that they are the correct ones:
screen_brightness (manual brightness level), auto_brightness_detail (for auto brightness level) and screen_brightness_mode (to switch between the modes).
I then set up a flow to save these values and turn them into global variables.
Another flow picks up those global variables and sets them. This is where things turn wierd.
The manual brightness is set to the correct value, but the auto brightness doesn´t change and the phone is always set to manual mode, regardless of which mode was saved.
The strangest part is that if I check the values of the variables (through the init system setings), they were correctly set back to the saved values. But if I check the phones beightness settings I can see that they were not restored to the saved settings (apart from the manual setting).
The log of my "set brightness settings" flow says that everything went fine. It shows me that all 3 variables were set from value y(current setting) to value x (saved setting).
any idea how to solve this issue?
EDIT: I just tried the "set brightness level" action, which can sucessfully set the auto level and the brightness mode. That shows that automagic can set those values, I just don´t know how to set them to my saved values.
So there are three variables that I need: Manual brightness level, automatic brightness level and the brightness level mode (auto or manual).
I went through the list of system settings and found three variables, which change their values according to my current settings, so I am quite sure that they are the correct ones:
screen_brightness (manual brightness level), auto_brightness_detail (for auto brightness level) and screen_brightness_mode (to switch between the modes).
I then set up a flow to save these values and turn them into global variables.
Another flow picks up those global variables and sets them. This is where things turn wierd.
The manual brightness is set to the correct value, but the auto brightness doesn´t change and the phone is always set to manual mode, regardless of which mode was saved.
The strangest part is that if I check the values of the variables (through the init system setings), they were correctly set back to the saved values. But if I check the phones beightness settings I can see that they were not restored to the saved settings (apart from the manual setting).
The log of my "set brightness settings" flow says that everything went fine. It shows me that all 3 variables were set from value y(current setting) to value x (saved setting).
any idea how to solve this issue?
EDIT: I just tried the "set brightness level" action, which can sucessfully set the auto level and the brightness mode. That shows that automagic can set those values, I just don´t know how to set them to my saved values.
Re: Which variable?
Setting the screen brightness can be tricky on Android since the system will usually not pick up the values when the values are directly set in the system settings database. However, Android usually picks up the new values when the screen is turned off and on again. Is this also the case on your device?
As an alternative, you could use the Init Variable System Setting to remember the values but use the regular action Set Screen Brightness to restore the values. The text fields for manual and adaptive brightness accept variables in the form {your_variable}.
As an alternative, you could use the Init Variable System Setting to remember the values but use the regular action Set Screen Brightness to restore the values. The text fields for manual and adaptive brightness accept variables in the form {your_variable}.
Re: Which variable?
Hi Martin,
thanks for your input and ideas.
You are right, after locking and unlocking the screen the values are updated, but it still won´t activate the automatic mode.
I also had a look into the other option (using the "set screen brightness"). But again I don´t know how I can make it tick or untick the auto mode...?
thanks for your input and ideas.
You are right, after locking and unlocking the screen the values are updated, but it still won´t activate the automatic mode.
I also had a look into the other option (using the "set screen brightness"). But again I don´t know how I can make it tick or untick the auto mode...?
Re: Which variable?
You can use two actions. One with auto-brightness checked and one without. Depending on how you have made your flow(s) the are a few different ways to determine which one to execute.eldron wrote:I don´t know how I can make it tick or untick the auto mode...?
Re: Which variable?
@Murtuma
That´s a good idea. So is it possible to set up a condition that checks the global value for screen_brightness_mode (possible values are 0 and 1)? Which conditon would I have to use for that?
Thanks for your help!
That´s a good idea. So is it possible to set up a condition that checks the global value for screen_brightness_mode (possible values are 0 and 1)? Which conditon would I have to use for that?
Thanks for your help!
Re: Which variable?
One way would be as follows:
Action init system setting: "screen_brightness_mode" (I assume it shows values 1 and 0 for on and off)
Condition expression: "screen_brightness_mode == 1"
→TRUE if auto brightness is on
→FALSE if it is off
You can also create your own boolean variables somewhere in your flow and then check it with similar expression condition to decide wollowing actions. You should choose the method depending on what suits your flow best, but the latter method has more diverse use cases.
Action init system setting: "screen_brightness_mode" (I assume it shows values 1 and 0 for on and off)
Condition expression: "screen_brightness_mode == 1"
→TRUE if auto brightness is on
→FALSE if it is off
You can also create your own boolean variables somewhere in your flow and then check it with similar expression condition to decide wollowing actions. You should choose the method depending on what suits your flow best, but the latter method has more diverse use cases.