Page 1 of 1

ACTION - Set Screen Timeout - variable input

Posted: 02 Apr 2018 13:28
by Automagician.gaurav
Hi Martin,

I want to be able to type in the number of minutes I want the screen to be on and then pass it to the flow.
Can we please (also) have a variable input for this?

I understand that many devices do not support wide range of values for screen timeout, but it's good to have an option.

Thanks

Re: ACTION - Set Screen Timeout - variable input

Posted: 02 Apr 2018 15:38
by Desmanto
It is android limitation. There is little benefit implementing it, as it mostly won't work.

The better solution it to create it by our own. Just use a Glovar Date/time as the reverter. You can set any minutes timeout as you want.

In the set timeout, set it to 24 hours or any longest screen timeout before "never". Then use script to set a glovar date/time to the timeout you want, example 2 hours (120 minutes)

Code: Select all

global_reset_timeout = addMinutes(getDates(), 120);
Then create another flow, use trigger glovar date/time, use this global_reset_timeout as the variable. The action only to set the timeout back to the original you want, example 2 minutes.

Re: ACTION - Set Screen Timeout - variable input

Posted: 04 Apr 2018 19:38
by Martin
Hi,

You can also try to set a custom timeout by using action Set System Setting, Category: System, Name: screen_off_timeout, and a value in milliseconds (e.g. 60000 for one minute).
Please note that some devices ignore custom values. Some devices also switch the setting back to one of the official values as soon as the system settings UI of the device is opened.

Regards,
Martin

Re: ACTION - Set Screen Timeout - variable input

Posted: 05 Apr 2018 18:16
by Automagician.gaurav
Martin wrote:Hi,

You can also try to set a custom timeout by using action Set System Setting, Category: System, Name: screen_off_timeout, and a value in milliseconds (e.g. 60000 for one minute).
Please note that some devices ignore custom values. Some devices also switch the setting back to one of the official values as soon as the system settings UI of the device is opened.

Regards,
Martin
Thanks Martin :) I appreciate your help.

Re: ACTION - Set Screen Timeout - variable input

Posted: 05 Apr 2018 18:23
by Automagician.gaurav
Desmanto wrote:It is android limitation. There is little benefit implementing it, as it mostly won't work.

The better solution it to create it by our own. Just use a Glovar Date/time as the reverter. You can set any minutes timeout as you want.

In the set timeout, set it to 24 hours or any longest screen timeout before "never". Then use script to set a glovar date/time to the timeout you want, example 2 hours (120 minutes)

Code: Select all

global_reset_timeout = addMinutes(getDates(), 120);
Then create another flow, use trigger glovar date/time, use this global_reset_timeout as the variable. The action only to set the timeout back to the original you want, example 2 minutes.
Thank you, this does promise a stable workflow. I'll try it.

I saw your list of important posts, loved it. Thanks a lot for putting it so much effort.