i am writing an app, and i just can't get what should be a simple substitution to work. i always struggle with this stuff.
i just want to turn on each device in turn with a one second delay between each. the on() method is supported for the device.
e.g. device1 is the name of the device (in the input section of the app).
the log shows that the device variable is correct (i.e. "device1").
the error is:
groovy.lang.MissingMethodException: No signature of method: java.lang.String.on() is applicable for argument types: () values: []
Possible solutions: drop(int), count(java.lang.CharSequence), join(java.lang.CharSequence, [Ljava.lang.CharSequence;), join(java.lang.CharSequence, java.lang.Iterable), toURL(), toURL() on line 608 (eventHandler)
def doThemAllwithDelays() {
doEachOne("device1")
runIn(1, doEachOne, [overwrite: false, data: "device2"])
runIn(2, doEachOne, [overwrite: false, data: "device3"])
}
def doEachOne(device) {
log.trace "device: ${device}"
"$device".on()
}