EAP version 1.29.0-dev

Forum to discuss everything related to the current development build of Automagic.

Moderator: Martin

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: EAP version 1.29.0-dev

Post by lchiocca » 18 Sep 2015 10:05

Just wanted to let you know that everything looks good :). I've been using it for a couple of days and haven't encountered anything unusual.

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

Re: EAP version 1.29.0-dev

Post by Martin » 22 Sep 2015 14:11

Good to know that it works now. I hope CM does not change the profile-features in the near future :-)

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

Re: EAP version 1.29.0-dev

Post by Martin » 22 Sep 2015 14:14

This version is considered feature complete. I will concentrate on testing and bug fixing in the next time.

Changes in this update:
  • new trigger Send/Share Multiple Intent Received
  • new action Remove WiFi Access Point
  • added more inbox types to trigger/condition Gmail Unread Conversation Count
  • added helper to test regular expressions in action Script
  • fixed actions Set GPS State and Set Network Location State on Android 6
  • minor changes and fixes
Download: Automagic.apk (2015-09-22)

natong
Posts: 75
Joined: 29 Aug 2015 05:24

Re: EAP version 1.29.0-dev

Post by natong » 29 Sep 2015 08:59

Martin wrote:
  • added support for break, continue and return in scripts
Now, we can exit the script block and continue on the next block ? and/or exit flow by a script command?

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

Re: EAP version 1.29.0-dev

Post by Martin » 29 Sep 2015 13:31

The new statements only have effect within an action Script, but don't allow to stop a entire flow immediately. You could use a condition Expression and end the flow on true/false when the rest of the flow should not be executed.

break: is used to stop evaluating expressions in the loop body and continue the script with the first expression after the loop
continue: is used to stop evaluating expressions within the loop body and to continue with the next iteration of the loop
return: ends the current script and returns the specified value

Regards,
Marti

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

Re: EAP version 1.29.0-dev

Post by Martin » 03 Oct 2015 13:18

A new EAP build is available.

Changes in this update:
  • minor changes and fixes
Download: Automagic.apk (2015-10-03)

gollyzila
Posts: 18
Joined: 15 Nov 2014 21:57

Re: EAP version 1.29.0-dev

Post by gollyzila » 05 Oct 2015 19:33

Hi Martin,

I'm trying to show a notification on my Moto 360 (with Notification on Statusbar) but it will not display on the watch if either "Ongoing" or "Keep on clear" setting is selected. I need this because I'm making a School profile for my phone that I want to be able to enable and disable from my watch.

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

Re: EAP version 1.29.0-dev

Post by Martin » 06 Oct 2015 14:37

This is a limitation of Android Wear, which will not show ongoing notifications posted on the phone. You either have to disable the "Ongoing" and "Keep on clear" flags or alternatively use a custom widget and show the widget on the wear device with Show Custom Widget Overlay (Android Wear). I think I could add a feature to post notifications directly on Android Wear which would probably also work for ongoing notifications. I'll add it to the todo-list.

Regards,
Martin

User avatar
poosterl
Posts: 3
Joined: 19 Jul 2013 10:01

Re: EAP version 1.29.0-dev

Post by poosterl » 08 Oct 2015 10:47

Hi Martin,

I wonder how I should use "return" in a script.
"return" is normally used to return a value form within functions.
Since (as far as I know) functions cannot be defined in an automagic script, I can only assume that "return" should be used at script level.
But how can a subsequent flow action access the value returned from the script then?

Tx in advance for your reply,

Peter.
Martin wrote:The new statements only have effect within an action Script, but don't allow to stop a entire flow immediately. You could use a condition Expression and end the flow on true/false when the rest of the flow should not be executed.

break: is used to stop evaluating expressions in the loop body and continue the script with the first expression after the loop
continue: is used to stop evaluating expressions within the loop body and to continue with the next iteration of the loop
return: ends the current script and returns the specified value

Regards,
Marti

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

Re: EAP version 1.29.0-dev

Post by Martin » 08 Oct 2015 18:13

You can use return to terminate a script early, without returning a value, but you could also use it in a condition Expression to return a boolean value, for example to return false when some preconditions are not met.

Code: Select all

if (var==null) {
  return false;
}

return var>5;
You could also use it to create something like functions with eval, admittedly quite a hack:

Code: Select all

xyz = eval("if (var==null) return false; return var>5;");
Regards,
Martin

Locked