def METHOD_NAME(value):
    mode = value[CONF_MODE]
    is_analog = mode[CONF_ANALOG]
    is_input = mode[CONF_INPUT]
    is_output = mode[CONF_OUTPUT]
    is_open_drain = mode[CONF_OPEN_DRAIN]
    is_pullup = mode[CONF_PULLUP]
    is_pulldown = mode[CONF_PULLDOWN]
    if is_open_drain and not is_output:
        raise cv.Invalid(
            "Open-drain only works with output mode", [CONF_MODE, CONF_OPEN_DRAIN]
        )
    if is_analog and not is_input:
        raise cv.Invalid("Analog pins must be an input", [CONF_MODE, CONF_ANALOG])
    if is_analog:
        # expect analog pin numbers to be available as either ADC# or A#
        number = value[CONF_NUMBER]
        board: str = CORE.data[KEY_LIBRETINY][KEY_BOARD]
        board_pins = _lookup_board_pins(board)
        analog_pins = [
            v
            for k, v in board_pins.items()
            if k[0] == "A" and k[1:].isnumeric() or k[0:3] == "ADC"
        ]
        if number not in analog_pins:
            raise cv.Invalid(
                f"Pin '{number}' is not an analog pin", [CONF_MODE, CONF_ANALOG]
            )
    # (input, output, open_drain, pullup, pulldown)
    supported_modes = {
        # INPUT
        (True, False, False, False, False),
        # OUTPUT
        (False, True, False, False, False),
        # INPUT_PULLUP
        (True, False, False, True, False),
        # INPUT_PULLDOWN
        (True, False, False, False, True),
        # OUTPUT_OPEN_DRAIN
        (False, True, True, False, False),
    }
    key = (is_input, is_output, is_open_drain, is_pullup, is_pulldown)
    if key not in supported_modes:
        raise cv.Invalid("This pin mode is not supported", [CONF_MODE])
    component: LibreTinyComponent = CORE.data[KEY_LIBRETINY][KEY_COMPONENT_DATA]
    if component.usage_validation:
        value = component.usage_validation(value)
    return value