.value

Posted on
Mon May 12, 2014 8:46 pm
Decker offline
Posts: 22
Joined: Jun 13, 2013

.value

Hi. I'm running into a new issue scripting something and I'm not sure why it's happening.

I've created a handful of scripts with basic if statements by getting a variable and then testing it by name without an issue.

For some reason I've created a new script and cannot get the if statement to test true without adding a .value to the end of the variable name.

For example the script below does not work:

Code: Select all
Humidistat = indigo.variables[723609922]
Dehumidifier = indigo.variables[1735952667]

if Humidistat == "Off" and Dehumidifier == "On":
   indigo.actionGroup.execute(72705535)


For example the script below does work:

Code: Select all
Humidistat = indigo.variables[723609922]
Dehumidifier = indigo.variables[1735952667]

if Humidistat.value == "Off" and Dehumidifier.value == "On":
   indigo.actionGroup.execute(72705535)


Is there a certain requirement that I have to add the .value to the end to certain variables?

Posted on
Mon May 12, 2014 9:16 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: .value

Humidistat = indigo.variables[723609922] is not a variable, its a definition of a shortcut for indigo.variables[723609922]

indigo.variables[723609922].value is the expression that gets the value

Posted on
Mon May 12, 2014 9:19 pm
Decker offline
Posts: 22
Joined: Jun 13, 2013

Re: .value

Thanks! I completely forgot to add it. Thank you.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests