Ringer status
Posted: 31 Mar 2013 19:20
UPDATE: I figured this out. I didn't know I had to declare global_ variables under the "manage" part of the application. Once I created it there, I could easily get and set it in my flow. That resolved my issue perfectly. However, I do have a question regarding global variables - do their values get retained when the phone is restarted and/or the flows applications is restarted?
I have written a flow that checks the time range so that my phone ringer is silenced during the night. It triggers every 15m and checks the time range between 12am and 6am. If true, it sets the ringer to silence. Otherwise, it sets the ringer to normal. It works great, but the other day I had to turn my ringer off manually (set it to vibrate). Later, went I went to turn my ringer back on I realized that the flow had already turned it back on because I was not within that time range of my flow.
I'm not sure how to resolve this issue. I need to know if I turned the ringer off manually or via the flow. Basically if I set the ringer to vibrate or silent manually I want it to remain in that state and not have the flow change it on me (unless the time range condition is true).
My initial trials have been to set/use a variable in my flow when I silence the ringer (something like silent=1 or global_silent=1). Then when the flow triggers again, I could check that variable in other another condition/expression. Problem is that I can't see that variable I set (in a script) using either global_silence=1 or just simply n=1. It's not showing up for me to use in my condition check. If I force the flow to go back up to the condition after setting the variable, it causes a loop condition and the flow is automatically terminated.
How can I achieve what I want? Any information would be greatly appreciated.
Best Regards,
DataCrypt
I have written a flow that checks the time range so that my phone ringer is silenced during the night. It triggers every 15m and checks the time range between 12am and 6am. If true, it sets the ringer to silence. Otherwise, it sets the ringer to normal. It works great, but the other day I had to turn my ringer off manually (set it to vibrate). Later, went I went to turn my ringer back on I realized that the flow had already turned it back on because I was not within that time range of my flow.
I'm not sure how to resolve this issue. I need to know if I turned the ringer off manually or via the flow. Basically if I set the ringer to vibrate or silent manually I want it to remain in that state and not have the flow change it on me (unless the time range condition is true).
My initial trials have been to set/use a variable in my flow when I silence the ringer (something like silent=1 or global_silent=1). Then when the flow triggers again, I could check that variable in other another condition/expression. Problem is that I can't see that variable I set (in a script) using either global_silence=1 or just simply n=1. It's not showing up for me to use in my condition check. If I force the flow to go back up to the condition after setting the variable, it causes a loop condition and the flow is automatically terminated.
How can I achieve what I want? Any information would be greatly appreciated.
Best Regards,
DataCrypt