diff --git a/web/weather.py b/web/weather.py index c33223b..6c2cf42 100755 --- a/web/weather.py +++ b/web/weather.py @@ -140,22 +140,37 @@ class WeatherInfo(object): wind_direction = influx_weather_client.query(wind_direction_q) wind_gust = influx_weather_client.query(wind_gust_q) hum_ext = influx_weather_client.query(hum_ext_q) - hum_int = influx_weather_client.query(hum_int_q) + #hum_int = influx_weather_client.query(hum_int_q) #press = influx_weather_client.query(press_q) #presr = influx_weather_client.query(presr_q) t_ext = influx_weather_client.query(t_ext_q) - t_int = influx_weather_client.query(t_int_q) + #t_int = influx_weather_client.query(t_int_q) # returned is a list, in this case, we just need one value [0] - result_windspeed = [speed for speed in wind_speed][0][0] - result_winddir = [direction for direction in wind_direction][0][0] - result_windgust = [gust for gust in wind_gust][0][0] + try: + result_windspeed = [speed for speed in wind_speed][0][0] + except: + result_windspeed = 1024 + try: + result_winddir = [direction for direction in wind_direction][0][0] + except: + result_winddir = 1024 + try: + result_windgust = [gust for gust in wind_gust][0][0] + except: + result_windgust =1024 #result_hum_int = [y for y in hum_int][0][0] #result_t_int = [c for c in t_int][0][0] #result_press = [z for z in press][0][0] #result_presr = [a for a in presr][0][0] - result_t_ext = [b for b in t_ext][0][0] - result_hum_ext = [x for x in hum_ext][0][0] + try: + result_t_ext = [b for b in t_ext][0][0] + except: + + try: + result_hum_ext = [x for x in hum_ext][0][0] + except: + # Put the time to a uhman readable format, strip nanosecs time_stamp = time.strptime(result_windspeed['time'].split('.')[0],