def process_light(self, light, data):
        """Processes a light event received from the OSC client."""

        if light not in self.machine.lights and self.wpc:

            if len(light) == 1:
                light = '0' + light

            if self.client_mode == 'wpc':
                # todo change to generator
                light = light.upper()
                for l in self.machine.lights:
                    if l.config['number_str'] == light:
                        light = l.name

        if light in self.machine.lights:
            self.machine.lights[light].on(int(255*data[0]))
        else:
            self.log.debug("Received OSC command for invalid light '%s'. "
                           "Ignorring...", light)
dataset/ETHPy150Open missionpinball/mpf/mpf/plugins/osc.py/OSC.process_light/original