Exemplo n.º 1
0
def update_avg_temp():
    global unit
    ts, val = dbops.calcDayAverage("temperature")
    ui.temp_unit_2.setText('degC')
    if (unit == 1):
        val = sensorRead.todegF(val)
        ui.temp_unit_2.setText('degF')
    ui.avg_temp.setText(str(round(val, 2)))
    ui.avg_temp_ts.setText(ts.strftime('%b-%d-%Y %H:%M:%S'))
Exemplo n.º 2
0
def update_avg_hum():
    ts, val = dbops.calcDayAverage("humidity")
    ui.avg_hum.setText(str(round(val, 2)))
    ui.avg_hum_ts.setText(ts.strftime('%b-%d-%Y %H:%M:%S'))