diff --git a/pywws2weewx.py b/pywws2weewx.py index 828be0e..56ae9aa 100644 --- a/pywws2weewx.py +++ b/pywws2weewx.py @@ -81,6 +81,8 @@ def __init__(self, idx, delay, hum_in, temp_in, hum_out, temp_out, abs_pressure, self.wind_ave = wind_ave self.wind_gust = wind_gust self.wind_dir = wind_dir # integer 0=N, 1=NNE..., 4=E..., 15=NNW + if len(wind_dir) == 0 # handle empty wind_dir + wind_dir = 0 if self.decode_status()["invalid_wind_dir"]: # The error code 0x800 (2048) self.wind_dir_deg = -9999 # -9999 is invalid wind in weewx_import else: @@ -396,4 +398,4 @@ def write_data_file(datafile, dataset): stats.print_stats() statsfile.close() sys.exit(0) - sys.exit(main()) \ No newline at end of file + sys.exit(main())