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

@@ -155,7 +155,7 @@ class serverConfiguration(object):
return False
self.val = {}
for line in config_list:
if line.strip() != '':
if line.strip() != '' and '[' not in line.strip():
try:
line = line.split("=")
option = line[0].strip().strip("'")

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):

View File

@@ -93,58 +93,6 @@ data['wind_monitor'],
temphumi_out = new Dygraph(
document.getElementById("temphumi"),
data['temphumi_monitor'],
{
axes : {
x : {
drawGrid: true,
drawAxis : false
},
y : {
drawGrid: false,
drawAxis : true,
},
y2 : {
drawGrid: false,
drawAxis: true,
independentTicks: true
}
},
rollPeriod: 5,
visibility: [false, true, false, true],
interactionModel: {},
connectSeparatedPoints: true,
series:{
'T(out)': {
axis: 'y',
color: '#705555',
fillGraph: true,
fillAlpha: 0.2
},
'T(ins)': {
axis: 'y',
color: '#705555',
fillGraph: true,
fillAlpha: 0.2
},
'Humi(out)': {
axis: 'y2',
color: '#222288'
},
'Humi(ins)': {
axis: 'y2',
color: '#222288'
}
},
ylabel: '<span style="color:#555555;">Outside [&deg;C]</span>',
y2label: '<span style="color:#222288;">Humidity [%]</span>',
labelsDiv: 'temphumi_labels',
legend: 'always'
}
);
temphumi_in = new Dygraph(
document.getElementById("temphumi_in"),
data['temphumi_monitor'],
{
axes : {
x : {
@@ -164,7 +112,7 @@ data['temphumi_monitor'],
}
},
rollPeriod: 5,
visibility: [true, false, true, false],
visibility: [true, true],
interactionModel: {},
connectSeparatedPoints: true,
series:{
@@ -174,19 +122,9 @@ data['temphumi_monitor'],
fillGraph: true,
fillAlpha: 0.2
},
'T(ins)': {
axis: 'y',
color: '#705555',
fillGraph: true,
fillAlpha: 0.2
},
'Humi(out)': {
axis: 'y2',
color: '#222288'
},
'Humi(ins)': {
axis: 'y2',
color: '#222288'
}
},
ylabel: '<span style="color:#555555;">Inside [&deg;C]</span>',
@@ -196,6 +134,7 @@ data['temphumi_monitor'],
}
);
/*
pressure = new Dygraph(
document.getElementById("pressure"),
data['pressure_monitor'],
@@ -238,7 +177,7 @@ data['pressure_monitor'],
labelsDiv: 'pressure_labels',
legend: 'always'
}
);
);*/
rrate = new Dygraph(
document.getElementById("rrate"),

View File

@@ -75,7 +75,7 @@
<h2>Temperature and Humidity</h2>
<div id="temphumi_labels"></div><div id="temphumi_labels_in"></div>
<div id="temphumi" class="container-fluid" style="width:100%;height:200px;"></div>
<div id="temphumi_in" class="container-fluid" style="width:100%;height:200px;"></div>
<!--<div id="temphumi_in" class="container-fluid" style="width:100%;height:200px;"></div>-->
<button type="button" class="btn btn-secondary" onclick="setBack('temphumi_monitor')">&lt;&lt;</button>
<button type="button" class="btn btn-secondary btn-sm" onclick="setHours('6','temphumi_monitor')">6h</button>
<button type="button" class="btn btn-secondary btn-sm" onclick="setHours('12','temphumi_monitor')">12h</button>
@@ -88,7 +88,7 @@
<h6><span id="g_tstamp_temphumi_monitor">{_timestamp}</span> UTC</h6>
</div>
</section>
<section class="row text-center placeholders">
<!--<section class="row text-center placeholders">
<div class="col">
<div id="pressure_labels"></div>
<div id="pressure" class="container-fluid" style="width:100%;height:200px;"></div>
@@ -102,7 +102,7 @@
<button type="button" class="btn btn-secondary" onclick="setForth('pressure_monitor')">&gt;&gt;</button>
<h6><span id="g_tstamp_pressure_monitor">{_timestamp}</span> UTC</h6>
</div>
</section>
</section>-->
<section class="row text-center placeholders">
<div class="col">
<div id="rrate_labels"></div>