Skip to content

Commit

Permalink
Correct initialisation of next_update
Browse files Browse the repository at this point in the history
For 'services' without catchup (e.g. mqtt) this was causing no data to
be sent when testing by running pywws.toservice from the command line.

Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Nov 3, 2017
1 parent 6489c63 commit b677065
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '17.07.0'
_release = '1376'
_commit = '3827aa8'
__version__ = '17.11.0'
_release = '1377'
_commit = '6489c63'
1 change: 1 addition & 0 deletions src/pywws/toservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def __init__(self, params, status, calib_data, service_name):
# set timestamp of first data to upload
self.next_update = datetime.utcnow() - max(
timedelta(days=self.catchup), self.interval)
self.next_update = min(self.next_update, self.data.before(datetime.max))

def prepare_data(self, data):
"""Prepare a weather data record.
Expand Down

0 comments on commit b677065

Please sign in to comment.