def METHOD_NAME(self,state,id,events):
    if state:
            if id==actPower.id:
                    for event in events:
                            if event[0] == 4:
                                if event[3] == 1: # power on
                                    self.SDL["enabled"] = (1,)
                                elif event[3] == 0:
                                    self.SDL["enabled"] = (0,)
                                else:
                                    PtDebugPrint("xButtonLeverSwitchPowered.OnNotify:\t'%s' ERROR---got bogus msg - power = %d" % (varstring.value,self.SDL["enabled"][0]))
                                    return
                                PtDebugPrint("xButtonLeverSwitchPowered.OnNotify:\t'%s' got msg - power = %d" % (varstring.value,self.SDL["enabled"][0]))
            if id==actClick.id:
                    if self.SDL["enabled"][0]:
                            respOn.run(self.key,events=events)
                            PtDebugPrint("xButtonLeverSwitchPowered.OnNotify:\t'%s' activated (powered)" % varstring.value)
                    else:
                            respOff.run(self.key,events=events)
                            PtDebugPrint("xButtonLeverSwitchPowered.OnNotify:\t'%s' activated (not powered)" % varstring.value)
                    return
            if id==respOn.id:
                    PtDebugPrint("xButtonLeverSwitchPowered.OnNotify:\tsending msg '%s' clicked, pulled or otherwise activated." % varstring.value)
                    note = ptNotify(self.key)
                    note.setActivate(1.0)
                    note.addVarNumber(varstring.value,1.0)
                    note.send()
                    return