In the BasicFunctionality example this is described:
#This Reset Frequency method is exposed to the user as a button that can be clicked.
@attribute(Browsable(True))
@attribute(OpenTap.EnabledIf("FrequencyIsDefault", False, HideIfDisabled = True))
@attribute(OpenTap.Display("Reset Frequency", None))
@method()
def resetFrequency(self):
self.Frequency = 1e9
You just need to declare that your method should be a CLR method.