I have several flows that speak and/or play sound files under certain conditions. However, as I refine my setup, I want to prevent speech/sound output under certain conditions. For example, I have flows that announce the time every hour, but I do not want them to do so if I am playing a full-screen game, or using Maps, or if I am listening to music (i.e. headset connected).
I have started setting up the conditions in each separate flow, but this is tedious and problematic, because it's easy to forget to modify a certain thing in a given flow, or even to modify a given flow entirely. There are quite a few apps that I do not want interrupted, for one thing.
A thought I had was to set a global variable in a standalone flow (e.g. if a "blacklisted" app is running or if a headset is connected), and have the other flows check the status of that variable. I guess I would need another flow to turn the variable back off when the conditions were no longer true as well, or perhaps the same flow could sleep/loop instead for that purpose.
Could someone please advise on the best approach to use for this? It's probably obvious that I'm not an advanced Automagic user, so the more detail, the better.
Need advice on how to handle cross-flow conditions
Moderator: Martin
Need advice on how to handle cross-flow conditions
Samsung Galaxy S9+ (unrooted and cannot/will not root), Android 9.0
Latest stable Automagic version, always
Latest stable Automagic version, always
Re: Need advice on how to handle cross-flow conditions
I would use your global variable approach myself. Easier to maintain as you only have one (or two) flows to edit the list of blacklisted apps.
I do something similar for flows to react to locations. I have global variable to represent the location and a flow that determines how that variable is set. Also has the advantage that I can trigger on that variable changing, as well as testing it in a condition
I do something similar for flows to react to locations. I have global variable to represent the location and a flow that determines how that variable is set. Also has the advantage that I can trigger on that variable changing, as well as testing it in a condition
