From: Alexander Vasarab Date: Thu, 7 Jan 2021 01:04:38 +0000 (-0800) Subject: Round relative humidity to one decimal place X-Git-Tag: v3.0.1^2~1^2 X-Git-Url: https://wylark.com/src/infoex-autowx.git/commitdiff_plain/25e1790265541d4fc5be280db49716a5f12415de Round relative humidity to one decimal place --- diff --git a/infoex-autowx.py b/infoex-autowx.py index aeac27c..cac8c3e 100755 --- a/infoex-autowx.py +++ b/infoex-autowx.py @@ -266,14 +266,15 @@ def main(): # expectations # # 0 decimal places: wind speed, wind direction, wind gust, snow depth - # 1 decimal place: air temp, baro + # 1 decimal place: air temp, relative humidity, baro # Avoid transforming None values if infoex['wx_data'][element_cd] is None: continue elif element_cd in ['wind_speed', 'WSPD', 'wind_direction', 'WDIR', 'wind_gust', 'SNWD', 'snow_depth']: infoex['wx_data'][element_cd] = round(infoex['wx_data'][element_cd]) - elif element_cd in ['TOBS', 'air_temp', 'PRES', 'pressure']: + elif element_cd in ['TOBS', 'air_temp', 'RHUM', + 'relative_humidity', 'PRES', 'pressure']: infoex['wx_data'][element_cd] = round(infoex['wx_data'][element_cd], 1) # CONSIDER: Casting every value to Float() -- need to investigate if