Chttpd generalisation, external data expunge

This commit is contained in:
2019-05-26 21:54:51 +02:00
parent 0817991329
commit 967d66d7c7

View File

@@ -150,15 +150,15 @@ class WeatherInfo(object):
try: try:
result_windspeed = [speed for speed in wind_speed][0][0] result_windspeed = [speed for speed in wind_speed][0][0]
except: except:
result_windspeed = 1024 result_windspeed = {'value': 1024}
try: try:
result_winddir = [direction for direction in wind_direction][0][0] result_winddir = [direction for direction in wind_direction][0][0]
except: except:
result_winddir = 1024 result_winddir = {'value': 1024}
try: try:
result_windgust = [gust for gust in wind_gust][0][0] result_windgust = [gust for gust in wind_gust][0][0]
except: except:
result_windgust =1024 result_windgust = {'value': 1024}
#result_hum_int = [y for y in hum_int][0][0] #result_hum_int = [y for y in hum_int][0][0]
#result_t_int = [c for c in t_int][0][0] #result_t_int = [c for c in t_int][0][0]
#result_press = [z for z in press][0][0] #result_press = [z for z in press][0][0]
@@ -166,11 +166,11 @@ class WeatherInfo(object):
try: try:
result_t_ext = [b for b in t_ext][0][0] result_t_ext = [b for b in t_ext][0][0]
except: except:
result_t_ext = 1024 result_t_ext = {'value': 1024}
try: try:
result_hum_ext = [x for x in hum_ext][0][0] result_hum_ext = [x for x in hum_ext][0][0]
except: except:
result_hum_ext = 1024 result_hum_ext = {'value': 1024}
# Put the time to a uhman readable format, strip nanosecs # Put the time to a uhman readable format, strip nanosecs
try: try:
@@ -180,9 +180,9 @@ class WeatherInfo(object):
time_stamp = time.strptime(result_t_ext['time'].split('.')[0], time_stamp = time.strptime(result_t_ext['time'].split('.')[0],
"%Y-%m-%dT%H:%M:%S") "%Y-%m-%dT%H:%M:%S")
except: except:
time_stamp = 1024 time_stamp = {'value': 1024}
except: except:
time_stamp = 2048 time_stamp = {'value': 2048}
result = {} result = {}