def _from_fan_speed(fan_speed: int) -> int:
    """Convert the Tradfri API fan speed to a percentage value."""
    nearest_10: int = round(fan_speed / 10) * 10  # Round to nearest multiple of 10
    return round(nearest_10 / 50 * 100)