diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e635ee..79506a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ * The ability to see pressure and visibility data has been added to historical hourly & yesterday hourly information. **BUG FIXES** -* Fixing multiple major bugs regarding invalid historical summary data & historical hourly data. - 30% done +* Fixed multiple major bugs regarding invalid historical summary data & historical hourly data * Fixed a bug where if you didn't have API key validation on, PyWeather validated your API key, and vice versa. * Fixed a potential bug where if there were two or more storms, on the last storm there wasn't code to let the storm go into extended forecast data. * Fixed potential bugs where PyWeather wouldn't properly display precip information for hurricane data - The algorithm was reworked. @@ -25,15 +25,17 @@ * Fixed a minor bug where if the summary section couldn't be added in the setup file, the print statement indicated that the cache section wasn't added. * Fixed a bug where PyWeather didn't catch bad visibility data on the detailed current weather screen. * Fixed a bug where PyWeather didn't catch bad UV index data on the detailed current weather screen. -* Fixed a bug where PyWeather didn't catch bad wind speed, visibility, and pressure data on the yesterday's weather summary screen. - 95% done, need to test -* Fixed a bug where the visibility in km on the yesterday's summary screen read as "kph". - 95% done, need to test +* Fixed a bug where PyWeather didn't catch bad wind speed, visibility, and pressure data on the yesterday's weather summary screen. +* Fixed a bug where the visibility in km on the yesterday's summary screen read as "kph". * Fixed a bug where PyWeather didn't catch bad current conditions data on yesterday's weather hourly data. * Fixed a bug where PyWeather didn't catch bad wind speed data on yesterday's weather hourly data. -* Fixing a minor bug where on yesterday's weather hourly data, the degree symbol was placed too far right by 1 character. +* Fixed a minor bug where on yesterday's weather hourly data, the degree symbol was placed too far right by 1 character. * Fixed a potential bug where missing data on yesterday's weather would cause a crash. * Fixed a potential bug where if almanac data is prefetched, it wouldn't display when viewing it in detail, and PyWeather would crash. * Fixed a minor bug where on the historical weather summary, total precipitation data in mm had a "mb" label. * Fixed a minor bug where historical hourly data wouldn't break when the current iterations equaled the total iterations. +* Fixed a minor bug where PyWeather wouldn't catch bad humidity data for current conditions. + **OTHER CHANGES** * The Git Updater has been completely removed, as it's been unreliable. A universal updater will be introduced later in time. diff --git a/configsetup.py b/configsetup.py index e379e84..0194cdb 100644 --- a/configsetup.py +++ b/configsetup.py @@ -192,7 +192,7 @@ config['CACHE']['yesterday_cachedtime'] = '720' config['RADAR GUI']['radar_imagesize'] = 'normal' config['RADAR GUI']['bypassconfirmation'] = 'False' - config['GEOCODER']['scheme'] = 'https' + config['GEOCODER']['scheme'] = 'http' config['PREFETCH']['10dayfetch_atboot']= 'False' config['PREFETCH']['hurricanedata_atboot'] = 'False' config['PREFETCH']['yesterdaydata_atboot'] = 'False' diff --git a/pyweather.py b/pyweather.py index bf6cd73..32335c9 100644 --- a/pyweather.py +++ b/pyweather.py @@ -1817,11 +1817,22 @@ def radar_clearImages(): # Since parsing the json spits out a float as the summary, a conversion to string is # necessary to properly display it in the summary. # summary_dewpointf = current_json['current_observation'] -summary_humidity = str(current_json['current_observation']['relative_humidity']) logger.debug("summary_overall: %s ; summary_lastupdated: %s" % (summary_overall, summary_lastupdated)) logger.debug("summary_tempf: %s ; summary_tempc: %s" % (summary_tempf, summary_tempc)) + +summary_humidity = str(current_json['current_observation']['relative_humidity']) +logger.debug("summary_humidity: %s" % summary_humidity) +# Check for bad humidity data +currentcond_showHumidity = True +logger.debug("currentcond_showHumidity: %s" % currentcond_showHumidity) + +if summary_humidity == "-999%": + logger.info("summary_humidity is '-999%'.") + currentcond_showHumidity = False + logger.debug("currentcond_showHumidity: %s" % currentcond_showHumidity) + summary_winddir = current_json['current_observation']['wind_dir'] summary_windmph = current_json['current_observation']['wind_mph'] summary_windmphstr = str(summary_windmph) @@ -2289,7 +2300,8 @@ def radar_clearImages(): print(Fore.YELLOW + Style.BRIGHT + "Current wind: " + Fore.CYAN + Style.BRIGHT + summary_windmphstr + " mph (" + summary_windkphstr + " kph), blowing " + summary_winddir + ".") else: print(Fore.YELLOW + Style.BRIGHT + "Wind data is not available for this location.") -print(Fore.YELLOW + Style.BRIGHT + "Current humidity: " + Fore.CYAN + Style.BRIGHT + summary_humidity) +if currentcond_showHumidity is True: + print(Fore.YELLOW + Style.BRIGHT + "Current humidity: " + Fore.CYAN + Style.BRIGHT + summary_humidity) print("") if yesterdaydata_onsummary is True: @@ -2458,11 +2470,20 @@ def radar_clearImages(): summary_lastupdated = current_json['current_observation']['observation_time'] summary_tempf = str(current_json['current_observation']['temp_f']) summary_tempc = str(current_json['current_observation']['temp_c']) - summary_humidity = str(current_json['current_observation']['relative_humidity']) logger.debug("summary_overall: %s ; summary_lastupdated: %s" % (summary_overall, summary_lastupdated)) logger.debug("summary_tempf: %s ; summary_tempc: %s" % (summary_tempf, summary_tempc)) + + summary_humidity = str(current_json['current_observation']['relative_humidity']) + logger.debug("summary_humidity: %s" % summary_humidity) + # Check again for bad humidity data. The variable is already defined in any condition at the start + # of PyWeather. + if summary_humidity == "-999%": + logger.info("summary_humidity is '-999%'.") + currentcond_showHumidity = False + logger.debug("currentcond_showHumidity: %s" % currentcond_showHumidity) + summary_winddir = current_json['current_observation']['wind_dir'] summary_windmph = current_json['current_observation']['wind_mph'] summary_windmphstr = str(summary_windmph) @@ -2585,7 +2606,8 @@ def radar_clearImages(): + " (" + current_windDegrees + " degrees)") else: print(Fore.YELLOW + Style.BRIGHT + "Wind data is not available for this location.") - print(Fore.YELLOW + Style.BRIGHT + "Current humidity: " + Fore.CYAN + Style.BRIGHT + summary_humidity) + if currentcond_showHumidity is True: + print(Fore.YELLOW + Style.BRIGHT + "Current humidity: " + Fore.CYAN + Style.BRIGHT + summary_humidity) print(Fore.YELLOW + Style.BRIGHT + "Current pressure: " + Fore.CYAN + Style.BRIGHT + current_pressureInHg + " inHg (" + current_pressureMb + " mb), " + current_pressureTrend2) if current_showvisibilitydata is True: @@ -5189,9 +5211,8 @@ def frontend_playerControls(btnName): # Check for bad wind data in the hourly - it's "". - if historical_windspeedKPH == "" or historical_windspeedMPH == "": - logger.info("historical_windspeedKPH: %s ; historical_windspeedMPH: %s" % - (historical_windspeedKPH, historical_windspeedMPH)) + if historical_windspeedKPH == "" or historical_windspeedKPH == "-9999.0" or historical_windspeedMPH == "" or historical_windspeedMPH == "-9999.0": + logger.info("historical_windspeedKPH is '' or historical_windspeedKPH is '-9999.0' or historical_windspeedMPH is '' or historical_windspeedMPH is '-9999.0") historical_showWindSpeed = False logger.debug("historical_showWindSpeed: %s" % historical_showWindSpeed) @@ -5354,15 +5375,14 @@ def frontend_playerControls(btnName): historical_totalloops = historical_totalloops + 1 logger.debug("historical_loops: %s ; historical_totalloops: %s" % (historical_loops, historical_totalloops)) + if user_showCompletedIterations == True: + print(Fore.YELLOW + Style.BRIGHT + "Completed iterations: " + Fore.CYAN + Style.BRIGHT + "%s/%s" + % (historical_totalloops, historicalhourlyLoops)) if historical_totalloops == historicalhourlyLoops: logger.debug("Iterations now %s. Total iterations %s. Breaking..." % (historical_totalloops, historicalhourlyLoops)) break - - if user_showCompletedIterations == True: - print(Fore.YELLOW + Style.BRIGHT + "Completed iterations: " + Fore.CYAN + Style.BRIGHT + "%s/%s" - % (historical_totalloops, historicalhourlyLoops)) if user_enterToContinue == True: if historical_loops == user_loopIterations: