ACTION - Set Screen Timeout - variable input

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
User avatar
Automagician.gaurav
Posts: 15
Joined: 25 Aug 2017 18:13

ACTION - Set Screen Timeout - variable input

Post by Automagician.gaurav » 02 Apr 2018 13:28

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
Thanks for reading this post.

- Gaurav
Automagician, India

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: ACTION - Set Screen Timeout - variable input

Post by Desmanto » 02 Apr 2018 15:38

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.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

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

Re: ACTION - Set Screen Timeout - variable input

Post by Martin » 04 Apr 2018 19:38

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

User avatar
Automagician.gaurav
Posts: 15
Joined: 25 Aug 2017 18:13

Re: ACTION - Set Screen Timeout - variable input

Post by Automagician.gaurav » 05 Apr 2018 18:16

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.
Thanks for reading this post.

- Gaurav
Automagician, India

User avatar
Automagician.gaurav
Posts: 15
Joined: 25 Aug 2017 18:13

Re: ACTION - Set Screen Timeout - variable input

Post by Automagician.gaurav » 05 Apr 2018 18:23

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.
Thanks for reading this post.

- Gaurav
Automagician, India

Locked