Skip to content

Commit

Permalink
Merge branch 'develop' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-slx committed Jun 20, 2021
2 parents 0655f1f + a01567c commit 9df4a46
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
16 changes: 11 additions & 5 deletions bin/user/weatherlink_live/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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")
Expand All @@ -162,17 +163,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):
Expand Down
7 changes: 6 additions & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -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="[email protected]",
Expand Down

0 comments on commit 9df4a46

Please sign in to comment.