Page 1 of 1

Plugin Zooper

Posted: 05 Jan 2014 19:03
by Kriggi23
Hi all.
I just played a bit with the zooper plugin but there is something realy annoying.
You have to remove always the quotes automagicly set by AM.
But for pasing variables to zooper they need to be removed.
Can you please fix this ;-)

TIA
Christian

Re: Plugin Zooper

Posted: 06 Jan 2014 17:31
by Martin
Hi,

Did you specify the variable in Zooper using the curly brace syntax (for example {test}) or did you just write text?

Regards,
Martin

Re: Plugin Zooper

Posted: 06 Jan 2014 17:57
by Kriggi23
Hi Martin,
what i did is made a flow with the action plugin: zooper press configuration and added the zooper variable and the AM variable in pure text (without brackets).
At the screen where the "script" is shown the AM variable is placed in quotes which i have to remove to make the flow working.

Btw. would be nice to be able to choose a AM variable at "zw text" ;-)

Gruß
Christian

Re: Plugin Zooper

Posted: 06 Jan 2014 18:25
by Martin
Hi Christian,

Please try to use the curly brace syntax in Zooper. In field ZW Text you have to write something like {test}.

Automagic replaces variables with curly braces like {test} in a string, otherwise it's just a constant string.
putString("...extra.STRING_TEXT", "test"); will only pass the text "test" to Zooper

test = "dynamic value";
putString("...extra.STRING_TEXT", "This is a {test}"); will replace {test} with the value contained in variable test before the string is passed to Zooper (results in "This is a dynamic value")

The dialog shown when you press "Configure" is part of Zooper. Automagic can not offer a variable selection in this screen.

Gruss
Martin

Re: Plugin Zooper

Posted: 06 Jan 2014 19:33
by Kriggi23
Hehe learned something new :-)
I think your way is much more flexibel so im following you.

Good to know i dont have to delete quotes over and over again!

Next ill have to check what i can do with AM and fhem to my homematic ;-)

Frohes neues Jahr noch
Christian

Re: Plugin Zooper

Posted: 15 Jul 2016 23:09
by newturn
Hi,

how to handle the case if the putstring function which is used starts with ' (one quote)? The vars {my_var} won't be parsed :(

Also how to use the array in a plugins dialog box for the whole {mylist[]} or {mylist()} or only {mylist} and just for one element {mylist3}?

thanks!

Re: Plugin Zooper

Posted: 16 Jul 2016 08:32
by Martin
Hi,

You can use double quotes if variables in a string literal should be replaced. Post an example, maybe I don't understand your case properly.

You can access the element of a list with brackets containing the index of the element: {mylist[3]}
Since you are in in a scripting context, you could also skip the entire string literal. Instead of: putString("xyz", "{mylist[3]}"); you could also write: putString("xyz", mylist[3]);
Passing the entire text of a list to a plugin could be achieved with: putString("xyz", "{mylist,listformat,comma}"); This will create a comma separated list in CSV-style including escaping of values when necessary. If escaping is not desired, you could also use putString("xyz", join(mylist, ","));

Regards,
Martin