diff --git a/weewx/VantagePro.py b/weewx/VantagePro.py index bb124bca..403ffc1e 100644 --- a/weewx/VantagePro.py +++ b/weewx/VantagePro.py @@ -113,21 +113,22 @@ class WxStation (object) : """Cancel an active LOOP request.""" self._wakeup_console() - def genArchivePackets(self, since_tt): + def genArchivePackets(self, since_ts): """A generator function to return archive packets from a VantagePro station. - since_tt: A time-tuple. All data since (but not including) this time will be returned. + since_ts: A timestamp. All data since (but not including) this time will be returned. Pass in None for all data yields: a sequence of DavisArchivePackets containing the data """ - if since_tt : + if since_ts : + since_tt = time.localtime(since_ts) # NB: note that some of the Davis documentation gives the year offset as 1900. # From experimentation, 2000 seems to be right, at least for the newer models: _vantageDateStamp = since_tt[2] + (since_tt[1]<<5) + ((since_tt[0]-2000)<<9) _vantageTimeStamp = since_tt[3] *100 + since_tt[4] - syslog.syslog(syslog.LOG_DEBUG, 'VantagePro: Getting archive packets since %s' % time.asctime(since_tt)) + syslog.syslog(syslog.LOG_DEBUG, 'VantagePro: Getting archive packets since %s' % weeutil.weeutil.timestamp_to_string(since_ts)) else : _vantageDateStamp = _vantageTimeStamp = 0 syslog.syslog(syslog.LOG_DEBUG, 'VantagePro: Getting all archive packets') @@ -136,7 +137,7 @@ class WxStation (object) : _datestr = struct.pack(" ", weeutil.weeutil.timestamp_to_string(rec['dateTime']), rec['barometer'],\ rec['outTemp'], rec['windSpeed'], rec['windDir'], " <-" self.archive.addRecord(rec)