Suggestions for extensions

151 views
Skip to first unread message

andi

unread,
Nov 25, 2023, 8:13:39 AM11/25/23
to Automate for Android

I started using Automate for Android more intensively since a couple of weeks and want to share some ideas about extensions I'd love to see. Perhaps other users have comments on them or can tell me some workarounds you used for similar situations?

I don't know, whether there is some dedicated channel or group to provide feedback / suggestions like this. Please let me know, if I should post this somewhere else.


a) a block to compare a variable with its atomic stored counterpart; e.g., compare and exit yes => if the value is the same as the stored; store the value and exit no => if the value was different

What is my use case and further comments:
  • I have a couple of flows sharing information and I want to trigger them only when a value changed
  • this can also be done by additional (temporary) variables, but it's less elegant
  • I did some test with the "Atomic compare and store", but I don't see it working for my use case

b) a simple text block to add comments to a flow

What is my use case and further comments:
  • larger flows tend to look spaghetti, some documentation would help to understand them
  • the text should be visible by just looking on the flow without clicking / opening the comment block

c) a way to turn logging on/off

What is my use case and further comments:
  • most of the time, I only use my own log messages via the "log append" block (less information, only what I'm interested in)
  • but in certain situations, I still would be interested in the internal logs and would love to trigger this by some logging on/off block

d) it would help me, if question marks could be added to the decision blocks in your the documentation (see "https://llamalab.com/automate/doc/block/index.html")

What is my use case and further comments:
  • this would make it easier for me to identify the block types in the online documentation
  • the add block function in the app already shows question marks for decision blocks

What do you think?

Henrik "The Developer" Lindqvist

unread,
Nov 25, 2023, 5:20:45 PM11/25/23
to Automate for Android
Thanks for the feedback.

a) The way to compare an Atomic value "atomically" is to use the Atomic compare & store block. A block to do it "not atomically" is just a regular Expression true block after its been loaded.

b) Already on the to-do list, until then place your comment in Label blocks.

c) I'll consider it.

andi

unread,
Nov 26, 2023, 9:11:59 AM11/26/23
to Automate for Android
Thanks for your reply.

a) I did look into the "Atomic compare & store" block, but it does not what I want. Or at least, I didn't figure an elegant way to do this. I have added some flow charts to elaborate my idea. Three simple variants (they seem somewhat large here in the conversation):

  • atomic block:

AutomateBlocks-AtomicConditionalStore.drawio.png
  • new function to be used in the expression true block:

AutomateBlocks-ExpressionTrue.drawio.png

  • new block to compare value with its stored counterpart:
AutomateBlocks-isValueStored.drawio.png

And thanks for (b) and (c) and all the rest of the software!!

Henrik "The Developer" Lindqvist

unread,
Nov 26, 2023, 1:14:31 PM11/26/23
to Automate for Android
Your first suggestion is exactly what the CAS block is for:

1. Variable: blah="old"
2. Atomic store: blah
3. Variable: blah="new"
4. Atomic CAS: Variable=blah, Expected value="old"
Y. /* the stored value was "old" that was replace with "new" */
N. /* the stored value was not "old", */

The second and third suggestion seems to be the same, and both are unnecessary since the outcome is always the same, that blah="new".
Message has been deleted

andi

unread,
Nov 27, 2023, 1:00:26 PM11/27/23
to Automate for Android
That's why I mentioned, the existing C&S block is not very elegant. With it, I need a second variable, to keep the expected value = "old" to compare.

It would be nice, if I would not have to use such an additional variable, because I think it's not needed. We just have to compare blah vs. stored blah.

And yes, I know that the two other suggestions have the same result. These are alternatives, as I don't know, whether you are rather in favor a new block or with new functions.

Henrik "The Developer" Lindqvist

unread,
Nov 28, 2023, 5:39:09 AM11/28/23
to Automate for Android
Agreed, it's a bit convoluted, but all the Atomic blocks works by taking an "atomic" variable name, so the flow can always work with it as a regular variable that's doesn't suddenly change.
In any programming language, comparing and then assigned in two separate operations, i.e. without using CAS, is concurrency bug.

8....@gmail

unread,
Nov 29, 2023, 5:52:10 AM11/29/23
to Automate for Android
Could you please tell me with what utility you created this flowchart

ב-יום ראשון, 26 בנובמבר 2023 בשעה 16:11:59 UTC+2, andi כתב/ה:
Reply all
Reply to author
Forward
0 new messages