mirror of
https://github.com/weewx/weewx.git
synced 2026-06-09 17:45:24 -04:00
default to hardware record generation for ws23xx stations
This commit is contained in:
@@ -247,7 +247,7 @@ import weewx.units
|
||||
import weewx.wxformulas
|
||||
|
||||
DRIVER_NAME = 'WS23xx'
|
||||
DRIVER_VERSION = '0.21'
|
||||
DRIVER_VERSION = '0.22'
|
||||
|
||||
|
||||
def loader(config_dict, _):
|
||||
@@ -422,22 +422,11 @@ class WS23xxDriver(weewx.drivers.AbstractDevice):
|
||||
self.polling_interval = stn_dict.get('polling_interval', None)
|
||||
if self.polling_interval is not None:
|
||||
self.polling_interval = int(self.polling_interval)
|
||||
self.disable_catchup = weeutil.weeutil.tobool(stn_dict.get('disable_catchup', False))
|
||||
|
||||
loginf('driver version is %s' % DRIVER_VERSION)
|
||||
loginf('serial port is %s' % self.port)
|
||||
loginf('polling interval is %s' % self.polling_interval)
|
||||
|
||||
# FIXME: this is a hack until we modify the driver api to have an
|
||||
# explicit genCatchupRecords method
|
||||
self.force_recgen = weeutil.weeutil.tobool(stn_dict.get('force_software_record_generation', True))
|
||||
if self.force_recgen:
|
||||
config_dict = stn_dict['config_dict']
|
||||
recgen = config_dict['StdArchive']['record_generation']
|
||||
if recgen.lower() != 'software':
|
||||
loginf("forcing record_generation to 'software'")
|
||||
config_dict['StdArchive']['record_generation'] = 'software'
|
||||
|
||||
@property
|
||||
def hardware_name(self):
|
||||
return self.model
|
||||
@@ -487,13 +476,10 @@ class WS23xxDriver(weewx.drivers.AbstractDevice):
|
||||
raise weewx.RetriesExceeded(msg)
|
||||
|
||||
def genArchiveRecords(self, since_ts, count=0):
|
||||
if self.disable_catchup:
|
||||
raise NotImplementedError
|
||||
with WS23xx(self.port) as s:
|
||||
last_rain = None
|
||||
for ts, data in s.gen_records(since_ts=since_ts, count=count):
|
||||
record = data_to_packet(data, ts,
|
||||
last_rain=last_rain)
|
||||
record = data_to_packet(data, ts, last_rain=last_rain)
|
||||
record['interval'] = data['interval']
|
||||
last_rain = record['rainTotal']
|
||||
yield record
|
||||
|
||||
@@ -113,6 +113,9 @@ For the fine offset stations, record connection status as rxCheckPercent
|
||||
(either 0 or 100%) and sensor battery status as outTempBatteryStatus (0
|
||||
indicates ok, 1 indicates low battery).
|
||||
|
||||
For WS23xx stations, hardware record generation is now enabled and is the
|
||||
default (previously, software record generation was the default).
|
||||
|
||||
|
||||
2.7.0 10/11/14
|
||||
|
||||
|
||||
Reference in New Issue
Block a user