Inside temp removed, so far. Outside temp not displayed bug fixed

This commit is contained in:
2019-08-25 22:14:15 +02:00
parent 7a3890e45e
commit 5b4509709f
4 changed files with 28 additions and 85 deletions

View File

@@ -371,20 +371,27 @@ class Expose(object):
def temphumi_monitor(self, **kwargs):
q = check_GET(kwargs)
temphumi_monitor = self.weather.temphumi_graph_data(**q)
header = "time,T(ins),T(out),Humi(ins),Humi(out)\n"
header = "time,T(out),Humi(out)\n"
yield header
for Thin, Thout in zip(temphumi_monitor['th_ins'],
temphumi_monitor['th_outs']):
tm_temp = str(Thin["time"]).strip()
temp_in_val = str(Thin["Temp"]).strip()
temp_out_val = str(Thout["Temp"]).strip()
hum_in_val = str(Thin["Hum"]).strip()
hum_out_val = str(Thout["Hum"]).strip()
yield "{},{},{},{},{}\n".format(tm_temp,
temp_in_val,
temp_out_val,
hum_in_val,
hum_out_val)
for Thout in temphumi_monitor['th_outs']:
print(Thout)
try:
tm_temp = str(Thout["time"]).strip()
except:
tm_temp = 'None'
try:
temp_out_val = str(Thout["Temp"]).strip()
except:
temp_out_val = 'None'
try:
hum_out_val = str(Thout["Hum"]).strip()
except:
hum_out_val = 'None'
yield "{},{},{}\n".format(tm_temp,
temp_out_val,
hum_out_val)
@cherrypy.expose
def usense_temphumi_monitor(self, **kwargs):
@@ -897,15 +904,12 @@ class DynamicWeather(object):
q['end'],
q['granularity'])
db_results = self.influx_weather_client.query(query)
th_in = db_results.get_points(measurement='temphumi',
tags={'type': 'internal'})
th_out = db_results.get_points(measurement='temphumi',
tags={'type': 'external'})
th_ints = [temphumi_in for temphumi_in in th_in]
th_outs = [temphumi_out for temphumi_out in th_out]
# Let's get the data from DB
result = {'th_ins':th_ints, 'th_outs':th_outs}
result = {'th_outs':th_outs}
return result
def pressure_graph_data(self, **q):