diff --git a/web/weather.py b/web/weather.py index 6c2cf42..46e26fa 100755 --- a/web/weather.py +++ b/web/weather.py @@ -166,15 +166,20 @@ class WeatherInfo(object): try: result_t_ext = [b for b in t_ext][0][0] except: - + result_t_ext = 1024 try: result_hum_ext = [x for x in hum_ext][0][0] except: - + result_hum_ext = 1024 # Put the time to a uhman readable format, strip nanosecs - time_stamp = time.strptime(result_windspeed['time'].split('.')[0], + try: + time_stamp = time.strptime(result_windspeed['time'].split('.')[0], "%Y-%m-%dT%H:%M:%S") + except: + time_stamp = time.strptime(result_t_ext['time'].split('.')[0], + "%Y-%m-%dT%H:%M:%S") + result = {} # Construct the result to return