@classmethod
def from_string(cls, string: str) ->'Mode':
    """Get an enum value from a string, defaulting to NORMAL."""
    encode = {'average': cls.AVERAGE, 'critical': cls.CRIT, 'maximum': cls.MAX}
    return encode.get(string.lower(), cls.NORMAL)
