mirror of
https://github.com/weewx/weewx.git
synced 2026-05-24 01:35:18 -04:00
Guard against a negative value for 'interval' in WMR200 stations.
This commit is contained in:
@@ -1943,7 +1943,12 @@ class WMR200(weewx.drivers.AbstractDevice):
|
||||
timestamp_packet_interval = timestamp_packet_current \
|
||||
- timestamp_packet_previous
|
||||
|
||||
if pkt.timestamp_record() > (timestamp_packet_previous
|
||||
if timestamp_packet_interval < 0:
|
||||
loginf(('genStartup() Discarding received archive record that presented out-of-order; '
|
||||
'current timestamp:%s; previous timestamp:%s')
|
||||
% (weeutil.weeutil.timestamp_to_string(timestamp_packet_current),
|
||||
weeutil.weeutil.timestamp_to_string(timestamp_packet_previous)))
|
||||
elif pkt.timestamp_record() > (timestamp_packet_previous
|
||||
+ self._archive_threshold):
|
||||
loginf(('genStartup() Discarding received archive'
|
||||
' record exceeding archive interval cnt:%d'
|
||||
|
||||
@@ -29,6 +29,8 @@ doing a merge to the new config file. Fixes issue #217.
|
||||
Example xstats now includes tags for last_year and last_year_todate.
|
||||
Thanks to user evilbunny2008. PR #325.
|
||||
|
||||
Guard against a negative value for 'interval' in WMR200 stations.
|
||||
|
||||
|
||||
3.8.2 08/15/2018
|
||||
|
||||
|
||||
Reference in New Issue
Block a user