Hi,
The 'sleep' action pauses the entire flow, but I wish to 'wait'! Is there such an action already avaliable? If not, is it possible to implement this feature?
Thanks.
Julian
Sleep vs Wait
Moderator: Martin
Re: Sleep vs Wait
If interval so huge, you can set interval trigger and wait for needeed date difference
All systems nominal.
Re: Sleep vs Wait
I know this thread is pretty old, but you should be able to just use a sleep() function in the Control UI action. Another way would be to create another flow with a Sleep action and then use the Execute Flows action with the Wait for called flows to finish option checked.
Hope my post was helpful
Device: OnePlus 5T running crDroid, rooted with Magisk
Device: OnePlus 5T running crDroid, rooted with Magisk
Re: Sleep vs Wait
The wait mentioned here probably refer a condition that wait for certain value to become true, before continuing. In that case, the better way is to use the trigger counterpart of the condititon. Or else, the solution is to use looped condition check over interval sleep. So maybe the flow run, check if condition fulfilled. If not, go to sleep 5 seconds, loop back to the condition, check again. This will make the flow run forever, creating a long wakelock and killing the battery.
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Sleep vs Wait
That's true, but unless it were to be a setting like auto rotate, it would require a global variable. I guess another way to do this is to just separate it into another flow and use action Execute Flows once the wait is over.
I did use this method to continuously check every few seconds if the screen was on AND the keyguard was unlocked but now, I just use a Keyguard Unlocked condition because as you said, it can drain the battery. Whenever I use this loop method, I would create a variable to count down from to limit the amount of "retries".Desmanto wrote: ↑15 Jun 2019 16:33Or else, the solution is to use looped condition check over interval sleep. So maybe the flow run, check if condition fulfilled. If not, go to sleep 5 seconds, loop back to the condition, check again. This will make the flow run forever, creating a long wakelock and killing the battery.
Hope my post was helpful
Device: OnePlus 5T running crDroid, rooted with Magisk
Device: OnePlus 5T running crDroid, rooted with Magisk
Re: Sleep vs Wait
Auto rotate state can be detected using Trigger System Setting Changed : [System] accelerometer_rotation : 0 >>> 1
Other state probably can be detected using the same trigger, but with different value.
If the loop wait-check is short, less than 1 minute, then you can loop several times and use the counter to limit number of check, so it doesn't loop forever. But if the wait is longer than 1 minute, better utilize global variable datetime (glovardt) trigger to implement the loop. Add the glovardt everytime the condition is false.
Other state probably can be detected using the same trigger, but with different value.
If the loop wait-check is short, less than 1 minute, then you can loop several times and use the counter to limit number of check, so it doesn't loop forever. But if the wait is longer than 1 minute, better utilize global variable datetime (glovardt) trigger to implement the loop. Add the glovardt everytime the condition is false.
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.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Sleep vs Wait
If you mean as a trigger, then yeah, that should do the trick. I was thinking of a check within a flow; my bad there.
I like to use a Expression condition to do this instead as you can manipulate the value however you want (eg. resetting it back to default). if the wait was longer though, I think the Global Variable trigger would be better suited for the job if he's waiting for a specific change in value.Desmanto wrote: ↑17 Jun 2019 17:06If the loop wait-check is short, less than 1 minute, then you can loop several times and use the counter to limit number of check, so it doesn't loop forever. But if the wait is longer than 1 minute, better utilize global variable datetime (glovardt) trigger to implement the loop. Add the glovardt everytime the condition is false.
Hope my post was helpful
Device: OnePlus 5T running crDroid, rooted with Magisk
Device: OnePlus 5T running crDroid, rooted with Magisk