From ea392abe28e76c294e1c59485fb7d5b042f39ca6 Mon Sep 17 00:00:00 2001 From: Bjarne Riis Date: Fri, 6 Sep 2024 12:46:50 +0200 Subject: [PATCH 1/4] Changed precip_type data from numeric value to a text string --- pyweatherflow_forecast/data.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/pyweatherflow_forecast/data.py b/pyweatherflow_forecast/data.py index 5ee9cc4..3e0fc8c 100644 --- a/pyweatherflow_forecast/data.py +++ b/pyweatherflow_forecast/data.py @@ -833,7 +833,22 @@ def precip_minutes_local_yesterday_final(self) -> int: @property def precip_type(self) -> str: """Return precipitation type.""" - return self._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: From 71019caf7ab923c628f8278053797701fddb9acb Mon Sep 17 00:00:00 2001 From: Bjarne Riis Date: Wed, 18 Sep 2024 08:19:24 +0200 Subject: [PATCH 2/4] Added precip_type_text as sensor --- pyweatherflow_forecast/data.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyweatherflow_forecast/data.py b/pyweatherflow_forecast/data.py index 3e0fc8c..29f5ed0 100644 --- a/pyweatherflow_forecast/data.py +++ b/pyweatherflow_forecast/data.py @@ -833,6 +833,11 @@ def precip_minutes_local_yesterday_final(self) -> int: @property 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" From d3780dda453398eba8b6f64e675416e03861bbf6 Mon Sep 17 00:00:00 2001 From: Bjarne Riis Date: Wed, 18 Sep 2024 08:22:38 +0200 Subject: [PATCH 3/4] 1.1.0 release Notes --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From 84498f73fdf0be7311537e53f679b85842d76a09 Mon Sep 17 00:00:00 2001 From: Bjarne Riis Date: Wed, 18 Sep 2024 08:23:22 +0200 Subject: [PATCH 4/4] Bump to 1.1.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",