Dynamic Method invocation in DTHs

I have a composite device with 5-10 'child' switches.
Each one has an on and off method - eg, on2, off4, etc.

When I get a callback into childOn, I'd love to do something like this:

def List childOn(dni)  {
	log("DEBUG", "childOn called in parent: dni=${dni} channelNumber(dni)=${channelNumber(dni)}")
	self."on${channelNumber(dni)}"()
}

This would work for a regular class, but doesn't work here, because DTHs aren't real objects - they're loaded and dispatched by the HE runtime.

Does anyone have any idea how to accomplish this?

Thanks!

def List childOn(dni)  {
	log("DEBUG", "childOn called in parent: dni=${dni} channelNumber(dni)=${channelNumber(dni)}")
	this."on${channelNumber(dni)}"()
}

:man_facepalming: wrong language! :muscle: Thanks, @bravenel