Page 1 of 1

[ANSWERED]: Manually setting a variable's value

PostPosted: Sun Feb 21, 2016 10:07 pm
by canalrun
I have a variable, MinLux, that I use as a comparison value against the luminance from an Aeon multisensor.

I would like to set the value of MinLux to 150.

Up to this point I've been opening a Python Shell and entering code similar to indigo.variable.updateValue(1234567, "150.0").

When I look in the Variable List window, I can see that the variable takes on the value 150.

Is there an easier way?

I am thinking of something like opening the Variables List window, right clicking on the variable, and entering the value in a pop-up text field.

Is there something like this?

On a related note: Have I entered the value for the variable correctly? What I am doing is comparing this variable to another variable that holds the luminance value from the Aeon sensor in the condition portion of a trigger to turn on a light (condition: if variable is less than variable) Will this comparison be performed as a numerical comparison? Even though I update the variable as a string value?

Thanks,
Barry.

Re: Manually setting a variable's value

PostPosted: Sun Feb 21, 2016 10:41 pm
by jblackburn
Barry,

I've you tried double click on the value of your variable within the variable windows? You'll find what you need! :wink:

Thanks!

Joel

Re: Manually setting a variable's value

PostPosted: Mon Feb 22, 2016 5:03 am
by shrxman
Also, you are storing the value correctly. You will need to convert it from a string to an int before you can do any arithmetic. I usually just convert it in the equation, as in int (var) + 150.

Re: [ANSWERED]: Manually setting a variable's value

PostPosted: Mon Feb 22, 2016 11:15 am
by canalrun
Thanks both.

That was certainly easy !

Currently I am using trigger Conditions to compare (variable less than variable). It seems to be comparing numerically.

I will probably switch to Python. Then I will need to convert types.

Barry.