set wind dir to None when no wind speed

This commit is contained in:
Matthew Wall
2015-01-07 04:22:23 +00:00
parent 14c9e694f8
commit 6aab7a7f2b
2 changed files with 9 additions and 0 deletions

View File

@@ -77,9 +77,16 @@ class StdWXCalculate(weewx.engine.StdService):
calc = True
if calc:
getattr(self, 'calc_'+obs)(data_us, data_type)
self.adjust_winddir(data_dict)
data_x = weewx.units.to_std_system(data_us, data_dict['usUnits'])
data_dict.update(data_x)
def adjust_winddir(self, data):
if 'windSpeed' in data and not data['windSpeed']:
data['windDir'] = None
if 'windGust' in data and not data['windGust']:
data['windGustDir'] = None
def calc_dewpoint(self, data, data_type):
if 'outTemp' in data and 'outHumidity' in data:
data['dewpoint'] = weewx.wxformulas.dewpointF(

View File

@@ -22,6 +22,8 @@ Fixed bug in calculation of inDewpoint.
Assign default units for extraHumid3,4,5,6,7, extraTemp4,5,6,7, leafTemp3,4,
and leafWet1,2.
Use StdWXCalculate to ensure that wind direction is None if no wind speed.
3.0.1 12/07/14