From 1e19a791a266923245a4a3c458a209d6e0d37f3f Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Sun, 20 Jun 2021 19:24:14 +0200 Subject: [PATCH 1/4] Fix packet emission loop With the changes of the previous release, push (broadcast) packets prevailed to the point where no push packets were emitted anymore. --- bin/user/weatherlink_live/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/user/weatherlink_live/__init__.py b/bin/user/weatherlink_live/__init__.py index 96cc210..93d4341 100644 --- a/bin/user/weatherlink_live/__init__.py +++ b/bin/user/weatherlink_live/__init__.py @@ -162,17 +162,22 @@ def genLoopPackets(self): self.data_event.wait(5) # do a check every 5 secs self.data_event.clear() - if self.poll_host.packets: + emitted_poll_packet = False + emitted_push_packet = False + + while self.poll_host.packets: self._log_success("Emitting poll packet") self._reset_data_count() + emitted_poll_packet = True yield self.poll_host.packets.popleft() - elif self.push_host.packets: + while self.push_host.packets: self._log_success("Emitting push (broadcast) packet") self._reset_data_count() + emitted_push_packet = True yield self.push_host.packets.popleft() - else: + if not emitted_poll_packet and not emitted_push_packet: self._increase_no_data_count() def start(self): From 2d1e66bdc64c88a9a6b09b582d7ea85c7cefe3fc Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Sun, 20 Jun 2021 19:29:14 +0200 Subject: [PATCH 2/4] Reword comment --- bin/user/weatherlink_live/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/user/weatherlink_live/__init__.py b/bin/user/weatherlink_live/__init__.py index 93d4341..9e64a5f 100644 --- a/bin/user/weatherlink_live/__init__.py +++ b/bin/user/weatherlink_live/__init__.py @@ -144,7 +144,8 @@ def genLoopPackets(self): raise InitializationError("Error while starting driver: %s" % str(e)) from e # Either it's the first iteration of the driver - # or we've just returned a packet and are now resuming the driver. + # or we've just created an archive packet and are + # now resuming the driver. self._reset_data_count() self._log_success("Entering driver loop") From 6e54cf116714a3d857100b0be88b70beaf7f988d Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Sun, 20 Jun 2021 19:32:33 +0200 Subject: [PATCH 3/4] Update changelog --- changes.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/changes.md b/changes.md index e4a0b14..b3b85a4 100644 --- a/changes.md +++ b/changes.md @@ -78,7 +78,7 @@ The driver only uses it for the rate of the rain collector spoon tripping. - **Retry failed HTTP requests** If HTTP requests fail, the driver will attempt to send them again up to 3 times. Should none of the attempts succeed, an exception will be raised. - + - **Make HTTP requests honor `socket_timeout` option** in configuration ([#11](https://github.com/michael-slx/weewx-weatherlink-live/issues/11)) Thanks to user [cube1us](https://github.com/cube1us) debugging this issue. @@ -101,3 +101,8 @@ The driver only uses it for the rate of the rain collector spoon tripping. - **Add additional log messages when receiving and decoding broadcast packets** When receiving broadcast messages, the size of the packet will be logged and a message will be printed when creating packet objects. +## Version 1.0.7 + +- **Fix packet emission loop** + + With the changes of the previous release, push (broadcast) packets prevailed to the point where no push packets were emitted anymore. From a01567ca8358a7fe4858537a39ddbfcbc715a2c2 Mon Sep 17 00:00:00 2001 From: Michael Schantl Date: Sun, 20 Jun 2021 19:33:48 +0200 Subject: [PATCH 4/4] Bump version to v1.0.7 --- bin/user/weatherlink_live/__init__.py | 2 +- install.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/user/weatherlink_live/__init__.py b/bin/user/weatherlink_live/__init__.py index 9e64a5f..924dfd7 100644 --- a/bin/user/weatherlink_live/__init__.py +++ b/bin/user/weatherlink_live/__init__.py @@ -34,7 +34,7 @@ from weewx.engine import InitializationError DRIVER_NAME = "WeatherLinkLive" -DRIVER_VERSION = "1.0.6" +DRIVER_VERSION = "1.0.7" log = logging.getLogger(__name__) diff --git a/install.py b/install.py index f851db6..24dfbd5 100644 --- a/install.py +++ b/install.py @@ -33,7 +33,7 @@ class WeatherLinkLiveInstaller(ExtensionInstaller): def __init__(self): super(WeatherLinkLiveInstaller, self).__init__( name='weatherlink-live', - version="1.0.6", + version="1.0.7", description='WeeWX driver for Davis WeatherLink Live.', author="Michael Schantl", author_email="floss@schantl-lx.at",