def _trip_protection_to_integer(trip_protection: bool) -> int:
    """Convert from True/False/None to 1/0/-1"""
    if trip_protection is None:
        return 0
    return 1 if trip_protection else -1