How to change PropertyValues value using PVMT addon?

This thread explains how you can set property value but it doesn’t covers the EnumerationPropertyValue case

The following code should cover EnumerationPropertyValue:

    @staticmethod
    def set_p_v_value(elem, PVName, value):
        for group in elem.get_java_object().getOwnedPropertyValueGroups():
            for pv in group.getOwnedPropertyValues():
                if PVName == pv.getName():
                    if isinstance(java_object, JavaObject):
                        pv.setValue(value.get_java_object())
                    else:
                        pv.setValue(value)
                    return

you can then call:

PVMT.set_p_v_value(pc, pvName, myEnumerationPropertyLiteral)