def METHOD_NAME(component_type: str, version: int, ip_address: str, port: int, id: int, num: Optional[int] = None):
    """ Ausführung des Moduls als Python-Skript
    """
    log.debug('Start reading flex')
    dev = Device(Flex(configuration=FlexConfiguration(ip_address=ip_address, port=port)))
    if component_type in COMPONENT_TYPE_TO_MODULE:
        component_config = COMPONENT_TYPE_TO_MODULE[component_type].component_descriptor.configuration_factory()
    else:
        raise Exception("illegal component type " + component_type +
                        ". Allowed values: " +
                        ','.join(COMPONENT_TYPE_TO_MODULE.keys()))
    component_config.id = num
    component_config.configuration.version = version
    component_config.configuration.id = id
    dev.add_component(component_config)
    log.debug('openWB flex Version: ' + str(version))
    log.debug('openWB flex-Kit IP-Adresse: ' + ip_address)
    log.debug('openWB flex-Kit Port: ' + str(port))
    log.debug('openWB flex-Kit ID: ' + str(id))
    dev.update()