diff --git a/bin/weewx/wxservices.py b/bin/weewx/wxservices.py index e392749a..10730677 100644 --- a/bin/weewx/wxservices.py +++ b/bin/weewx/wxservices.py @@ -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( diff --git a/docs/changes.txt b/docs/changes.txt index 87a9dc3f..7ac3f5cf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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