Unschedule Function?


#1

Okay, I am totally lost here. I have multiple devices that run off the same custom driver and it has not given me any problem until this one device. I am using the unschedule() function to unschedule previously scheduled jobs and it works fine for all but on device. For some reason, with this device I get the following error:
groovy.lang.MissingMethodException: No signature of method: java.lang.Boolean.call() is applicable for argument types: () values: []
Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), and(java.lang.Boolean), each(groovy.lang.Closure) on line 66 (off)

What can this possibly be doing?!?!? It works fine for 10 different devices with almost the same exact name. There is only one device that this gives this error for.


#2

post up line 66, or better yet the entire method that encompasses line 66...


#3
def off() {
	if (logEnable){ log.debug "Turned Off"}
	sendEvent(name: "switch", value: "off", isStateChange: true)
	unschedule()
	if (maxOff) {
		if (logEnable) log.debug("Turning On in "+maxOffTime+" hours")
		def delay=(maxOffTime.toInteger())*3600
		runIn (delay, onP)
	}
}

line 66 is unschedule()

image

I create another device and it is also working fine for that one. So, I am just moving everything over to that device (these are all virtual) so I'm just going to work around it. But I would sure love to understand what the heck is going on.


#4

Any idea @mike.maxwell?


#5

I don't know what the point of unschedule here.
Are you trying to remove legacy jobs from ported drivers?, or trying to use this to prevent onP from running...


#6

if you comment out line 66, does it run fine? It seems like an odd error to occur at that line.


#7

To Unschedule other pending jobs already scheduled. Is that not the correct way to do that?

Yes. However, it also runs fine with line 66 on every device except for one. I guess it really doesn't matter at this point, I've deleted the affect device and just created a new virtual device to replace the one affected.