From a9f131cd5ef32a3e7641b25df7fc9eda21e690cd Mon Sep 17 00:00:00 2001 From: DL1RF Date: Fri, 18 Aug 2017 19:46:03 +0200 Subject: [PATCH] My first small fixes and changes to the vantage driver (#268) Mostly minor cosmetic changes for the `--info` command --- bin/weewx/drivers/vantage.py | 20 ++++++++++---------- docs/hardware.htm | 24 +++++++++++++++++++++--- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/bin/weewx/drivers/vantage.py b/bin/weewx/drivers/vantage.py index a6308976..55dda2ed 100644 --- a/bin/weewx/drivers/vantage.py +++ b/bin/weewx/drivers/vantage.py @@ -1029,7 +1029,7 @@ class Vantage(weewx.drivers.AbstractDevice): _altitude = float(_bardata[1].split()[1]) _dewpoint = float(_bardata[2].split()[2]) _virt_temp = float(_bardata[3].split()[2]) - _c = float(_bardata[4].split()[1]) + _c = float(_bardata[4].split()[1])/10.0 _r = float(_bardata[5].split()[1])/1000.0 _barcal = float(_bardata[6].split()[1])/1000.0 _gain = float(_bardata[7].split()[1]) @@ -1740,7 +1740,7 @@ class VantageService(Vantage, weewx.engine.StdService): # Save the battery statuses: for k in self.loop_data: - self.loop_data[k] = event.packet[k] + self.loop_data[k] = event.packet.get(k) def end_archive_period(self, event): # @UnusedVariable """Zero out the max gust seen since the start of the record""" @@ -1978,7 +1978,7 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): Altitude: %.0f feet Dew point: %.0f F Virtual temperature: %.0f F - Humidity correction factor: %.0f + Humidity correction factor: %.1f Correction ratio: %.3f Correction constant: %+.3f inHg Gain: %.3f @@ -1993,9 +1993,9 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): print >> dest, """ OFFSETS: Wind direction: %(wind)+.0f deg Inside Temperature: %(inTemp)+.1f F - Inside Humidity: %(inHumid)+.0f%% + Inside Humidity: %(inHumid)+.0f %% Outside Temperature: %(outTemp)+.1f F - Outside Humidity: %(outHumid)+.0f%%""" % calibration_dict + Outside Humidity: %(outHumid)+.0f %%""" % calibration_dict if transmitter_list is not None: # Only print the calibrations for channels that we are # listening to. @@ -2083,9 +2083,9 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): ans = None while ans not in ['y', 'n']: if barometer_inHg: - print "Proceeding will set the barometer value to %.3f and the station altitude to %.1f feet." % (barometer_inHg, _bardata[1]) + print "Proceeding will set the barometer value to %.3f and the station altitude to %.0f feet." % (barometer_inHg, _bardata[1]) else: - print "Proceeding will have the console pick a sensible barometer calibration and set the station altitude to %.1f feet," % (_bardata[1],) + print "Proceeding will have the console pick a sensible barometer calibration and set the station altitude to %.0f feet," % (_bardata[1],) ans = raw_input("Are you sure you wish to proceed (y/n)? ") if ans == 'y': station.setBarData(barometer_inHg, _bardata[1]) @@ -2171,7 +2171,7 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): # Wind direction can also be calibrated. if variable == "windDir": offset = int(offset_str) - if not -359 < offset < 359: + if not -359 <= offset <= 359: print >> sys.stderr, "Wind direction offset %d is out of range." % (offset) else: ans = None @@ -2187,7 +2187,7 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): print "Wind direction offset now set to %+d." % (offset) elif variable in temp_variables: offset = float(offset_str) - if not -12.8 < offset < 12.7: + if not -12.8 <= offset <= 12.7: print >> sys.stderr, "Temperature offset %+.1f is out of range." % (offset) else: ans = None @@ -2203,7 +2203,7 @@ class VantageConfigurator(weewx.drivers.AbstractConfigurator): print "Temperature offset %s now set to %+.1f." % (variable, offset) elif variable in humid_variables: offset = int(offset_str) - if not -100 < offset < 100: + if not 0 <= offset <= 100: print >> sys.stderr, "Humidity offset %+d is out of range." % (offset) else: ans = None diff --git a/docs/hardware.htm b/docs/hardware.htm index bf43e0ae..82348cdb 100644 --- a/docs/hardware.htm +++ b/docs/hardware.htm @@ -1084,6 +1084,9 @@ Version: 3.7

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option

@@ -1444,6 +1447,9 @@ interval: 1

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option

@@ -1722,6 +1728,9 @@ Mutating actions will request confirmation before proceeding.

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option

@@ -2299,6 +2308,9 @@ confirmation before proceeding.

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option

@@ -2430,7 +2442,7 @@ confirmation before proceeding. Altitude: 700 feet Dew point: 55 F Virtual temperature: 59 F - Humidity correction factor: 27 + Humidity correction factor: 2.7 Correction ratio: 1.025 Correction constant: +0.000 inHg Gain: 0.000 @@ -2439,9 +2451,9 @@ confirmation before proceeding. OFFSETS: Wind direction: +0 deg Inside Temperature: +0.0 F - Inside Humidity: +0% + Inside Humidity: +0 % Outside Temperature: +0.0 F - Outside Humidity: +0% + Outside Humidity: +0 % Extra Temperature 1: +0.0 F

The console version number is available only on consoles with firmware dates after about 2006.

@@ -4339,6 +4351,9 @@ confirmation before proceeding.

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option

@@ -4658,6 +4673,9 @@ Transceiver is paired to console

Configuring with wee_device

+

+ Action --help

+

Invoking wee_device with the --help option