prevent fine offset stations from saving data with zero interval

This commit is contained in:
Matthew Wall
2019-05-19 18:11:18 -04:00
parent 6e7078dfad
commit a9a5ae2c4d
2 changed files with 5 additions and 2 deletions

View File

@@ -220,7 +220,7 @@ import weewx.drivers
import weewx.wxformulas
DRIVER_NAME = 'FineOffsetUSB'
DRIVER_VERSION = '1.9'
DRIVER_VERSION = '1.10'
def loader(config_dict, engine):
return FineOffsetUSB(**config_dict[DRIVER_NAME])
@@ -1318,7 +1318,7 @@ class FineOffsetUSB(weewx.drivers.AbstractDevice):
while dts > dt and count < num_rec:
raw_data = self.get_raw_data(ptr)
data = self.decode(raw_data)
if data['delay'] is None or data['delay'] > 30:
if data['delay'] is None or data['delay'] < 1 or data['delay'] > 30:
logerr('invalid data in get_records at 0x%04x, %s' %
(ptr, dts.isoformat()))
dts -= datetime.timedelta(minutes=fixed_block['read_period'])

View File

@@ -63,6 +63,9 @@ Fixed bug in WS1 driver that caused crash if rain_total was None.
If a file user/schemas.py still exists (a relic from V2.7 and earlier), it
is renamed to user/schemas.py.old. Fixes issue #54.
Fixed fine offset driver to warn about (and skip) historical data that have
zero for interval.
3.9.1 02/06/2019