def process_message(self, addr, tags, data, client_address):
        """Receives OSC messages and acts on them."""

        if self.config['debug_messages']:
            self.log.debug("Incoming OSC message. Client IP: %s, Message: %s, %s"
                          ", %s", client_address, addr, tags, data)

        # Separate the incoming message into category and name parts.
        # For example "/sw/rollover1" is split into "sw" and "rollover1"

        cat = (addr.split("/"))[1]  # [1] since addr begins with a delimiter

        try:
            name = addr.split("/")[2]
        except:
            name = None  # catches incoming messages that are just one part

        # if this client is not connected, set up a connection
        if client_address not in self.OSC_clients:
            self.found_new_osc_client(client_address)

        if cat.upper() == 'SW':
            self.process_switch(name, data)
        elif cat.upper() == 'REFRESH':
            self.client_needs_sync = True  # is this used anymore?
        elif cat.upper() == 'LIGHT':
            self.process_light(name, data)
        elif cat.upper() == 'COIL':
            self.process_coil(name, data)
        elif cat.upper() == 'EV':
            self.process_event(name, data)
        elif cat.upper() == 'AUDITS':
            self.update_audits(name, data)
        elif cat.upper() == 'CONFIG':
            self.process_config(name, data)
        elif cat.upper() == 'SYNC':
            if data[0] == 1:
                self.client_mode = 'name'
                self.client_update_all()
        elif cat.upper() == 'WPCSYNC':
            if data[0] == 1:
                self.client_mode = 'wpc'
                self.client_update_all()
        elif cat.upper() == 'FLIPPER':
            self.process_flipper(name, data)
        elif self.config['debug_messages']:
            self.log.info("Last incoming OSC message was invalid")
dataset/ETHPy150Open missionpinball/mpf/mpf/plugins/osc.py/OSC.process_message/original