diff --git a/pyproject.toml b/pyproject.toml index e47846f..c819210 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "PyBMKG" -version = "3.0.0" +version = "3.0.1" description = "Python BMKG API Wrapper" authors = ["Kira "] maintainers = ["Kira ", "vexra "] diff --git a/src/bmkg/enums/weather.py b/src/bmkg/enums/weather.py index 4bcd56e..ffb0907 100644 --- a/src/bmkg/enums/weather.py +++ b/src/bmkg/enums/weather.py @@ -13,19 +13,19 @@ class Weather(IntEnum): Attributes: CLEAR_SKIES: `0` - PARTLY_CLOUDY: `1` - PARTLY_CLOUDY2: `2` + SUNNY: `1` + PARTLY_CLOUDY: `2` MOSTLY_CLOUDY: `3` OVERCAST: `4` HAZE: `5` SMOKE: `10` + THUNDER: `17` FOG: `45` - LIGHT_RAIN: `60` - RAIN: `61` - HEAVY_RAIN: `63` + LIGHT_RAIN: `61` + MODERATE_RAIN: `63` ISOLATED_SHOWER: `80` - SEVERE_THUNDERSTORM: `95` - SEVERE_THUNDERSTORM2: `97` + THUNDERSTORM: `95` + SEVERE_THUNDERSTORM: `97` Examples: >>> Weather(0) @@ -38,24 +38,19 @@ class Weather(IntEnum): True >>> print(Weather.CLEAR_SKIES) 0 - - Note: - There is `PARTLY_CLOUDY` and `PARTLY_CLOUDY2`, the weather - condition is equal only the number representation is different. This is - also hold true for `SEVERE_THUNDERSTORM` and `SEVERE_THUNDERSTORM2`. """ CLEAR_SKIES: int = 0 - PARTLY_CLOUDY: int = 1 - PARTLY_CLOUDY2: int = 2 + SUNNY: int = 1 + PARTLY_CLOUDY: int = 2 MOSTLY_CLOUDY: int = 3 OVERCAST: int = 4 HAZE: int = 5 SMOKE: int = 10 + THUNDER: int = 17 FOG: int = 45 - LIGHT_RAIN: int = 60 - RAIN: int = 61 - HEAVY_RAIN: int = 63 + LIGHT_RAIN: int = 61 + MODERATE_RAIN: int = 63 ISOLATED_SHOWER: int = 80 - SEVERE_THUNDERSTORM: int = 95 - SEVERE_THUNDERSTORM2: int = 97 + THUNDERSTORM: int = 95 + SEVERE_THUNDERSTORM: int = 97 diff --git a/src/bmkg/parsers/parse_weather_forecast_data.py b/src/bmkg/parsers/parse_weather_forecast_data.py index 27e637c..2ca4d3e 100644 --- a/src/bmkg/parsers/parse_weather_forecast_data.py +++ b/src/bmkg/parsers/parse_weather_forecast_data.py @@ -21,7 +21,8 @@ def parse_weather_forecast_data( location = parse_location_data(weather_forecast_data["lokasi"]) weathers = [ parse_weather_data(weather) - for weather in weather_forecast_data["data"][0]["cuaca"][0] + for weathers in weather_forecast_data["data"][0]["cuaca"] + for weather in weathers ] return WeatherForecast(location, weathers)