Add-on Dev: Extract int value from Blender's enum flag set?
You can access the value through the RNA properties. Assuming that you have stored modes in a PointerProperty and assigned to bpy.types.Scene.demo_tool (just an example), you can access it in the following way:

The first step is to get access to the RNA properties of demo_tool or in general the object that contains your EnumProperty. This will give us access to the underlying data structure of modes which contains the mapping to the integer values.

demo_tool = bpy.context.scene.demo_tool
items = demo_tool.bl_rna.properties["modes"].enum_items


The enum_items give you access to a collection (bpy_prop_collection) of EnumProperties which represent the valid (single) flags you can use. It allows a look-up with a key. For example the following code gives you the integer value for your 'LP' flag, by accessing the EnumPropertyItem.

items['LP'].value


Since you have a set of strings stored in modes when using options={'ENUM_FLAG'} you must iterate through it to get the integer value for each flag.

for flag in demo_tool.modes:
    print(f"{items[flag].value}")


Once you have the integers you can perform the boolean logic operations to create a single value. 



import bpy


class DemoSettings(bpy.types.PropertyGroup):
    GA = 1 &lt;&lt; 0  # activator for asset mode
    LP = 1 &lt;&lt; 1  # activator for low poly mode
    HP = 1 &lt;&lt; 2  # activator for high poly mode
    CU = 1 &lt;&lt; 3  # activator for custom mode

    # string based flag values for Blender controls
    opflags = [
        ('GA', "Asset", "desc", GA),
        ('LP', "Low", "desc", LP),
        ('HP', "High", "desc", HP),
        ('CU', "Custom", "desc", CU)
    ]

    # property using flags
    modes: bpy.props.EnumProperty(
        name="Modes",
        options={'ENUM_FLAG'},
        items=opflags,
        default={'GA', 'LP', 'HP', 'CU'}
    )


class DEMO_PT_panel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "My own addon"
    bl_category = "Name of your tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        demo_tool = context.scene.demo_tool

        row = layout.row()
        row.prop(demo_tool, "modes")

        items = demo_tool.bl_rna.properties["modes"].enum_items

        flag_value = 0

        for flag in demo_tool.modes:
            flag_value |= items[flag].value

        row.label(text=str(flag_value))


classes = (DemoSettings,
           DEMO_PT_panel)


def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.demo_tool = bpy.props.PointerProperty(type=DemoSettings)


def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)


if __name__ == "__main__":
    register()