def METHOD_NAME(self, config, deviceName):
    print(deviceName)
    device_type = config.get('Type')
    if device_type == 'TwoButtonControl':
        self.logger.info('adding TwoButtonControl')
        return TwoButtonControl(
            config.getint('Pin1'),
            config.getint('Pin2'),
            self.getFunctionCall(config.get('functionCall1')),
            self.getFunctionCall(config.get('functionCall2')),
            functionCallTwoBtns=self.getFunctionCall(config.get('functionCallTwoButtons')),
            pull_up_down=config.get('pull_up_down', fallback='pull_up'),
            hold_mode=config.get('hold_mode', fallback=None),
            hold_time=config.getfloat('hold_time', fallback=0.3),
            bouncetime=config.getint('bouncetime', fallback=500),
            edge=config.get('edge', fallback='falling'),
            antibouncehack=config.getboolean('antibouncehack', fallback=False),
            name=deviceName)
    elif device_type in ('Button', 'SimpleButton'):
        return SimpleButton(config.getint('Pin'),
                            action=self.getFunctionCall(config.get('functionCall')),
                            action2=self.getFunctionCall(config.get('functionCall2', fallback='None')),
                            name=deviceName,
                            bouncetime=config.getint('bouncetime', fallback=500),
                            antibouncehack=config.getboolean('antibouncehack', fallback=False),
                            edge=config.get('edge', fallback='falling'),
                            hold_mode=config.get('hold_mode', fallback=None),
                            hold_time=config.getfloat('hold_time', fallback=0.3),
                            pull_up_down=config.get('pull_up_down', fallback='pull_up'))
    elif device_type == 'LED':
        return LED(config.getint('Pin'),
                            name=deviceName,
                            initial_value=config.getboolean('initial_value', fallback=True))
    elif device_type in ('StatusLED', 'MPDStatusLED'):
        return StatusLED(config.getint('Pin'), name=deviceName)
    elif device_type == 'RotaryEncoder':
        return RotaryEncoder(config.getint('Pin1'),
                config.getint('Pin2'),
                self.getFunctionCall(config.get('functionCall1')),
                self.getFunctionCall(config.get('functionCall2')),
                config.getfloat('timeBase', fallback=0.1),
                name=deviceName)
    elif device_type == 'ShutdownButton':
        return ShutdownButton(pin=config.getint('Pin'),
                              action=self.getFunctionCall(config.get('functionCall', fallback='functionCallShutdown')),
                              name=deviceName,
                              bouncetime=config.getint('bouncetime', fallback=500),
                              antibouncehack=config.getboolean('antibouncehack', fallback=False),
                              edge=config.get('edge', fallback='falling'),
                              hold_time=config.getfloat('hold_time', fallback=3.0),
                              iteration_time=config.getfloat('iteration_time', fallback=0.2),
                              led_pin=config.getint('led_pin', fallback=None),
                              pull_up_down=config.get('pull_up_down', fallback='pull_up'))
    self.logger.warning('cannot find {}'.format(deviceName))
    return None