Multiple "setLevel" defined methods in one Device Driver

Hi,
I'm looking at a SmartThings generated dimmer device driver (see below).
It contains duplicate "def SetLevel" methods. Since the drive seems to work I'm assuming groovy can tell the difference by the number of arguments (Map length?) being passed to it.

Am I in the right ballpark?

Thanks
John

def setLevel(level) {
	setLevel(level, 1)
}

def setLevel(level, duration) {
	if(level > 99) level = 99
	commands([
		zwave.switchMultilevelV3.switchMultilevelSet(value: level, dimmingDuration: duration),
		zwave.switchMultilevelV3.switchMultilevelGet(),
	], (duration && duration < 12) ? (duration * 1000) : 3500)
}

Yes, based on the number of arguments.

@mike.maxwell,

Thanks, seemed logical but wasn't sure.

John

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.