From 3e59ab2bcdcbea3eca9c6523d43ef7445fe8d989 Mon Sep 17 00:00:00 2001 From: Matthew Wall Date: Wed, 29 Jan 2014 13:24:28 +0000 Subject: [PATCH] fix metric/metricwx speeds --- bin/weewx/restx.py | 10 +++++++--- docs/customizing.htm | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/weewx/restx.py b/bin/weewx/restx.py index b5a46a10..a7994c4e 100644 --- a/bin/weewx/restx.py +++ b/bin/weewx/restx.py @@ -1465,8 +1465,12 @@ class AWEKASThread(RESTThread): def get_url(self, in_record): - # Convert to Metric: - record = weewx.units.to_METRICWX(in_record) + # Convert to units required by awekas + record = weewx.units.to_METRIC(in_record) + if record.has_key('dayRain') and record['dayRain'] is not None: + record['dayRain'] = record['dayRain'] * 10 + if record.has_key('rainRate') and record['rainRate'] is not None: + record['rainRate'] = record['rainRate'] * 10 # assemble an array of values in the proper order values = [self.username] @@ -1479,7 +1483,7 @@ class AWEKASThread(RESTThread): values.append(self._format(record, 'outTemp')) # C values.append(self._format(record, 'outHumidity')) # % values.append(self._format(record, 'barometer')) # mbar - values.append(self._format(record, 'dayRain')) # mm? + values.append(self._format(record, 'dayRain')) # mm values.append(self._format(record, 'windSpeed')) # km/h values.append(self._format(record, 'windDir')) values.append('') # weather condition diff --git a/docs/customizing.htm b/docs/customizing.htm index 6e4cc981..c81ebeb5 100644 --- a/docs/customizing.htm +++ b/docs/customizing.htm @@ -3278,8 +3278,8 @@ class="symcode">$CONFIG_ROOT/weewx.conf knot
meter_per_second mile_per_hour - km_per_hour meter_per_second + km_per_hour group_speed2 @@ -3290,8 +3290,8 @@ class="symcode">$CONFIG_ROOT/weewx.conf knot2
meter_per_second2 mile_per_hour2 - km_per_hour2 meter_per_second2 + km_per_hour2 group_temperature