From b1a58fc0260d0b385efeb83159f1bb61233a8991 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Wed, 1 Jun 2022 17:25:16 -0600 Subject: [PATCH] Release 1.3.1 (#15) --- CHANGELOG.md | 2 +- README.md | 4 ++++ pyproject.toml | 2 +- pyweatherflowudp/__init__.py | 2 +- pyweatherflowudp/device.py | 2 +- test/test_version.py | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 678e697..706b659 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# unreleased +# 1.3.1 (2022-06-01) - Handle up_since oscillation on devices - Rename private initialization variables in device class for clarity diff --git a/README.md b/README.md index 3b1b1d9..d22eabc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![pypi](https://img.shields.io/pypi/v/pyweatherflowudp?style=for-the-badge)](https://pypi.org/project/pyweatherflowudp) +[![downloads](https://img.shields.io/pypi/dm/pyweatherflowudp?style=for-the-badge)](https://pypi.org/project/pyweatherflowudp) +[![Buy Me A Coffee/Beer](https://img.shields.io/badge/Buy_Me_A_☕/🍺-F16061?style=for-the-badge&logo=ko-fi&logoColor=white&labelColor=grey)](https://ko-fi.com/natekspencer) + # pyweatherflowudp An event-based asynchronous library to read UDP packets from Weatherflow weather systems on a local network without any reliance on the cloud. diff --git a/pyproject.toml b/pyproject.toml index 2e95ea4..c229686 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyweatherflowudp" -version = "1.3.0" +version = "1.3.1" description = "An event-based asynchronous library to read UDP packets from Weatherflow weather systems on a local network without any reliance on the cloud." license = "MIT" authors = ["Nathan Spencer "] diff --git a/pyweatherflowudp/__init__.py b/pyweatherflowudp/__init__.py index 4547059..3d75f46 100644 --- a/pyweatherflowudp/__init__.py +++ b/pyweatherflowudp/__init__.py @@ -1,2 +1,2 @@ """Asynchronous library to read UDP Packets from Weatherflow weather systems.""" -__version__ = "1.3.0" +__version__ = "1.3.1" diff --git a/pyweatherflowudp/device.py b/pyweatherflowudp/device.py index 6cf5bd1..a05d712 100644 --- a/pyweatherflowudp/device.py +++ b/pyweatherflowudp/device.py @@ -280,6 +280,7 @@ def parse_device_status(self, data: dict[str, Any]) -> None: """Parse the device status.""" old_up_since = (self._timestamp or 0) - self._uptime self._timestamp = data.get(DATA_TIMESTAMP) + assert self._timestamp self._uptime = data.get(DATA_UPTIME, 0) # Tempest devices seem to have a timestamp/uptime combo that oscillates +/- a few seconds. # Attempt to correct this by adjusting the uptime if the difference is less than 60 seconds. @@ -299,7 +300,6 @@ def parse_device_status(self, data: dict[str, Any]) -> None: self._initial_status_complete = True self._send_load_complete_event() - assert self._timestamp self.emit( EVENT_STATUS_UPDATE, CustomEvent(self._timestamp, EVENT_STATUS_UPDATE) ) diff --git a/test/test_version.py b/test/test_version.py index 93808cb..1b8c3df 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -4,4 +4,4 @@ def test_version() -> None: """Test version.""" - assert __version__ == "1.3.0" + assert __version__ == "1.3.1"