Chttpd generalisation, external data expunge

This commit is contained in:
2019-05-26 18:27:58 +02:00
parent edb50210d4
commit 4ab580bd23

View File

@@ -185,24 +185,20 @@ class DynamicData(object):
hum_out_query = "{} {} {}".format(hum_q1, out_q2, q3) hum_out_query = "{} {} {}".format(hum_q1, out_q2, q3)
rs_temp_in = self.influx_weather_client.query(temp_in_query) rs_temp_in = self.influx_weather_client.query(temp_in_query)
rs_temp_out = self.influx_weather_client.query(temp_out_query) rs_temp_out = self.influx_weather_client.query(temp_out_query)
rs_hum_in = self.influx_weather_client.query(hum_in_query) #rs_hum_in = self.influx_weather_client.query(hum_in_query)
rs_hum_out = self.influx_weather_client.query(hum_out_query) #rs_hum_out = self.influx_weather_client.query(hum_out_query)
# Let's get the data from DB # Let's get the data from DB
header = "time,T(ins),T(out),Humi(ins),Humi(out)\n" header = "time,T(ins),T(out),Humi(ins),Humi(out)\n"
yield header yield header
for Tin, Tout, Hin, Hout in zip(rs_temp_in['temphumi'], for Tout, Hout in zip(rs_temp_out['temphumi'],
rs_temp_out['temphumi'],
rs_hum_in['temphumi'],
rs_hum_out['temphumi']): rs_hum_out['temphumi']):
tm_temp = str(Tin["time"]).strip() tm_temp = str(Tin["time"]).strip()
temp_in_val = str(Tin["temp"]).strip()
temp_out_val = str(Tout["temp"]).strip() temp_out_val = str(Tout["temp"]).strip()
hum_in_val = str(Hin["hum"]).strip()
hum_out_val = str(Hout["hum"]).strip() hum_out_val = str(Hout["hum"]).strip()
#if tm_speed == tm_gust and tm_speed == tm_direction: #if tm_speed == tm_gust and tm_speed == tm_direction:
#tm = strptime(speed["time"]).strip(), "%Y-%m-%dT%H:%M:%SZ") #tm = strptime(speed["time"]).strip(), "%Y-%m-%dT%H:%M:%SZ")
yield "{},{},{},{},{}\n".format(tm_temp, temp_in_val, temp_out_val, hum_in_val, hum_out_val) yield "{},{},{},{},{}\n".format(tm_temp, temp_out_val, hum_out_val)
@cherrypy.expose @cherrypy.expose
def pressure_monitor(self, **kwargs): def pressure_monitor(self, **kwargs):