mirror of
https://github.com/weewx/weewx.git
synced 2026-04-18 16:46:56 -04:00
ignore historical records with future timestamps
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user