def convert_sky_code(sky_code):
    """
    Convert sky code into the following code, handling only sunny and cloudy

    SKY Code: refer to weather station API document
        1: sunny,
        2: partly cloudy,
        3: mostly cloudy
        4: cloudy

    2,3,4 mapped to 2

    Weather Code: Own implementation
        1: sunny
        2: rainy (not handled by this function)
        3: cloudy
        4: snowy (not handled by this function)

    :param sky_code: SKY code from open API
    :return: weather code
    """

    weather_code = 0

    if sky_code == 1:
        weather_code = 1
    elif sky_code == 2 or sky_code == 3 or sky_code == 4:
        weather_code = 3

    return weather_code