diff --git a/bin/weewx/drivers/wmr300.py b/bin/weewx/drivers/wmr300.py index adf515ce..b4957ea8 100644 --- a/bin/weewx/drivers/wmr300.py +++ b/bin/weewx/drivers/wmr300.py @@ -790,7 +790,7 @@ from weeutil.weeutil import timestamp_to_string log = logging.getLogger(__name__) DRIVER_NAME = 'WMR300' -DRIVER_VERSION = '0.30' +DRIVER_VERSION = '0.31' DEBUG_COMM = 0 DEBUG_PACKET = 0 @@ -1337,8 +1337,13 @@ class WMR300Driver(weewx.drivers.AbstractDevice): time.sleep(0.001) def genStartupRecords(self, since_ts): + now = time.time() for rec in self.get_history(since_ts): - yield rec + ts = rec.get('dateTime') + if ts and ts < now: + yield rec + else: + log.info('ignored historical record: %s' % rec) def convert(self, pkt, ts): # if debugging packets, log everything we got diff --git a/docs/changes.txt b/docs/changes.txt index dce3c253..90ba5744 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -106,6 +106,8 @@ Use of strftime() date and time format codes in template file names is now supported as an alternative to the legacy 'YYYY', 'MM' and 'DD'. The legacy codes continue to be supported for backwards compatibility. Fixes issue #415. +In WMR300 driver, ignore historical records with timestamp in the future. + 3.9.2 07/14/2019