Hello!
In one of my customized apps, the app won't initialize and I found that it is directly correlated to the code below
def illum = sensor.currentValue("illuminance")
def FindUnit = sensor.currentState("illuminance")
def i = 0
def s = dimmers.size()
def dimmersLevelState = []
def dimmersSwitchState = []
for(s!=0;i<s;i++)
{
def lvState = dimmers[i].currentValue("level") as String
def swState = dimmers[i].currentValue("switch") as String
dimmersLevelState << lvState
dimmersSwitchState << swState
}
boolean atLeastOneIsOn = on in dimmersSwitchState // ??? why does it refuse to initialize when I type "on" here???
As stated in the comment, if I type :
boolean atLeastOneIsOn = "on" in dimmersSwitchState
it won't initialize... I don't get it, because nowhere have I declared a variable called "on" so how can groovy take it as an object of some sort and not require a string, while lists, if I'm correct, are lists of strings...?
NB: I don't get any error message, the page is simply stuck with the little blue spinning circle until I refresh the page. It WILL init if and only if I take the "" out of the expression, just as if on was a required object in this expression.
Thanks in advance