My first small fixes and changes to the vantage driver (#268)

Mostly minor cosmetic changes for the `--info` command
This commit is contained in:
DL1RF
2017-08-18 19:46:03 +02:00
committed by Tom Keffer
parent eb2760f9c7
commit a9f131cd5e
2 changed files with 31 additions and 13 deletions

View File

@@ -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

View File

@@ -1084,6 +1084,9 @@ Version: 3.7
<h2 id='cc3000_configuration'>Configuring with <span class="code">wee_device</span></h2>
<h3 id="cc3000_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>
@@ -1444,6 +1447,9 @@ interval: 1</pre>
<h2 id="fousb_configuration">Configuring with <span class="code">wee_device</span></h2>
<h3 id="fousb_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>
@@ -1722,6 +1728,9 @@ Mutating actions will request confirmation before proceeding.</pre>
<h2 id="te923_configuration">Configuring with <span class="code">wee_device</span></h2>
<h3 id="te923_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>
@@ -2299,6 +2308,9 @@ confirmation before proceeding.
<h2 id="vantage_configuration">Configuring with <span class="code">wee_device</span></h2>
<h3 id="vantage_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>
@@ -2430,7 +2442,7 @@ confirmation before proceeding.</pre>
<span class="highlight">Altitude: 700 feet</span>
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.</pre>
OFFSETS:
<span class="highlight">Wind direction: +0 deg</span>
<span class="highlight">Inside Temperature: +0.0 F</span>
<span class="highlight">Inside Humidity: +0%</span>
<span class="highlight">Inside Humidity: +0 %</span>
<span class="highlight">Outside Temperature: +0.0 F</span>
<span class="highlight">Outside Humidity: +0%</span>
<span class="highlight">Outside Humidity: +0 %</span>
<span class="highlight">Extra Temperature 1: +0.0 F</span></pre>
<p>The console version number is available only on consoles with firmware dates after about 2006.</p>
@@ -4339,6 +4351,9 @@ confirmation before proceeding.</pre>
<h2 id="ws23xx_configuration">Configuring with <span class="code">wee_device</span></h2>
<h3 id="ws23xx_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>
@@ -4658,6 +4673,9 @@ Transceiver is paired to console</pre>
<h2 id="ws28xx_configuration">Configuring with <span class="code">wee_device</span></h2>
<h3 id="ws28xx_help">
Action <span class="code">--help</span></h3>
<p>Invoking <a href="utilities.htm#wee_device_utility"><span class='code'>wee_device</span></a> with the
<span class='code'>--help</span> option</p>