from typing import Optional


def validate_state_of_charge_max(state_of_charge_max: Optional[float]) -> Optional[float]:
    """
    Validates the state of charge max of an object.
    State of charge max is always optional.

    :param state_of_charge_max: The state of charge max of the object.
    :return: The validated state of charge max.
    """
    if state_of_charge_max is None:
        return None
    if state_of_charge_max < 0 or state_of_charge_max > 1:
        raise ValueError("State of charge max must be between 0 and 1.")

    return state_of_charge_max