diff --git a/CHANGELOG.md b/CHANGELOG.md index 7637aa6..e339dfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ -## Release 1.0.12 +## Release 1.1.0 -**Date**: `NOT RELEASED` +**Date**: `2024-09-18` ### Changes - Bumped Python to 3.12 in Devcontainer +- Added `precip_type_text` sensor, which describes what type of precipitation is measured. (No Rain, Rain or Heavy Rain/Hail) ## Release 1.0.11 diff --git a/pyweatherflow_forecast/data.py b/pyweatherflow_forecast/data.py index 5ee9cc4..29f5ed0 100644 --- a/pyweatherflow_forecast/data.py +++ b/pyweatherflow_forecast/data.py @@ -835,6 +835,26 @@ def precip_type(self) -> str: """Return precipitation type.""" return self._precipitation_type + @property + def precip_type_text(self) -> str: + """Return precipitation type.""" + + _default_value = "no_rain" + + if self._precipitation_type is None: + self._precipitation_type = 0 + + mapping_text = { + "0": _default_value, + "1": "rain", + "2": "heavy_rain", + } + + for key, value in mapping_text.items(): + if self._precipitation_type == float(key): + return value + return _default_value + @property def pressure_trend(self) -> str: """Pressure trend text.""" diff --git a/setup.py b/setup.py index 58828ac..bafddf7 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setuptools.setup( name="pyweatherflow-forecast", - version="1.0.12", + version="1.1.0", author="briis", author_email="bjarne@briis.com", description="Gets the weather forecast data from WeatherFlow",