def __init__(self, machine):
        self.log = logging.getLogger('infolights')
        self.machine = machine

        try:
            self.config = self.machine.config['info_lights']
        except KeyError:
            self.machine.log.debug('"info_lights:" section not found in machine '
                                   'configuration, so the Info Lights plugin '
                                   'will not be used.')
            return

        self.flash = [
            {'color': 'ff', 'tocks': 1},
            {'color': '0', 'tocks': 1},
        ]

        # convert any light names we find to objects
        for k, v in self.config.iteritems():
            if 'light' in v:
                if v['light'] in self.machine.lights:
                    self.config[k]['light'] = self.machine.lights[v['light']]

        self.machine.events.add_handler('ball_started', self.ball_started)
        self.machine.events.add_handler('game_ended', self.game_ended)
        self.machine.events.add_handler('game_starting', self.game_starting)
        self.machine.events.add_handler('player_add_success', self.player_added)
        self.machine.events.add_handler('tilt', self.tilt)
        self.machine.events.add_handler('match', self.match)

        self.game_ended()  # set the initial lights to the game ended state
dataset/ETHPy150Open missionpinball/mpf/mpf/plugins/info_lights.py/InfoLights.__init__/original