Exemplo n.º 1
0
def save_wind_reading(wind_speed):
    add_reading_to_dequeue(Wind_Q, wind_speed)
    
    now = Now.get()
    now.Out_Wind_Now = wind_speed
    now.Out_Wind_Avg = sum(Wind_Q['Q']) / float(len(Wind_Q['Q']))
    now.Out_Wind_Max = max(Wind_Q['Q'])
Exemplo n.º 2
0
def save_wind_reading(wind_speed):
    add_reading_to_dequeue(Wind_Q, wind_speed)

    now = Now.get()
    now.Out_Wind_Now = wind_speed
    now.Out_Wind_Avg = sum(Wind_Q['Q']) / float(len(Wind_Q['Q']))
    now.Out_Wind_Max = max(Wind_Q['Q'])
Exemplo n.º 3
0
def trigger_sensor_rain():
    #Add this to the rain table
    now = database.Table_Rain(quantity=settings.rainTipAmount, time=datetime.datetime.now())
    
    #Now update the now table
    now = Now.get()
    now.Out_Rain_Since_Reset = now.Out_Rain_Since_Reset + settings.rainTipAmount
    logging.getLogger("thread-rain").info(" rain bucket tipped.")
Exemplo n.º 4
0
def save_attic_reading(temp, humid):
    add_reading_to_dequeue(ATT_Temp_Q, temp)
    add_reading_to_dequeue(ATT_Humid_Q, humid)
    
    now = Now.get()
    now.Attic_Temp = sum(ATT_Temp_Q['Q']) / float(len(ATT_Temp_Q['Q']))
    now.Attic_Humid = sum(ATT_Humid_Q['Q']) / float(len(ATT_Humid_Q['Q']))
    
    logging.getLogger("sensor").debug(" Updated attic sensor data.")
Exemplo n.º 5
0
def save_inside_reading(temp, humid):
    add_reading_to_dequeue(IN_Temp_Q, temp)
    add_reading_to_dequeue(IN_Humid_Q, humid)
    
    now = Now.get()
    now.In_Temp = sum(IN_Temp_Q['Q']) / float(len(IN_Temp_Q['Q']))
    now.In_Humid = sum(IN_Humid_Q['Q']) / float(len(IN_Humid_Q['Q']))
    
    logging.getLogger("sensor").debug(" Updated inside sensor data.")
Exemplo n.º 6
0
def save_attic_reading(temp, humid):
    add_reading_to_dequeue(ATT_Temp_Q, temp)
    add_reading_to_dequeue(ATT_Humid_Q, humid)

    now = Now.get()
    now.Attic_Temp = sum(ATT_Temp_Q['Q']) / float(len(ATT_Temp_Q['Q']))
    now.Attic_Humid = sum(ATT_Humid_Q['Q']) / float(len(ATT_Humid_Q['Q']))

    logging.getLogger("sensor").debug(" Updated attic sensor data.")
Exemplo n.º 7
0
def save_inside_reading(temp, humid):
    add_reading_to_dequeue(IN_Temp_Q, temp)
    add_reading_to_dequeue(IN_Humid_Q, humid)

    now = Now.get()
    now.In_Temp = sum(IN_Temp_Q['Q']) / float(len(IN_Temp_Q['Q']))
    now.In_Humid = sum(IN_Humid_Q['Q']) / float(len(IN_Humid_Q['Q']))

    logging.getLogger("sensor").debug(" Updated inside sensor data.")
Exemplo n.º 8
0
def trigger_sensor_rain():
    #Add this to the rain table
    now = database.Table_Rain(quantity=settings.rainTipAmount,
                              time=datetime.datetime.now())

    #Now update the now table
    now = Now.get()
    now.Out_Rain_Since_Reset = now.Out_Rain_Since_Reset + settings.rainTipAmount
    logging.getLogger("thread-rain").info(" rain bucket tipped.")
Exemplo n.º 9
0
def save_outside_reading(temp, humid):
    add_reading_to_dequeue(OUT_Temp_Q, temp)
    add_reading_to_dequeue(OUT_Humid_Q, humid)
    
    now = Now.get()
    
    now.Out_Temp = sum(OUT_Temp_Q['Q']) / float(len(OUT_Temp_Q['Q']))
    now.Out_Humid = sum(OUT_Humid_Q['Q']) / float(len(OUT_Humid_Q['Q']))
    
    logging.getLogger("sensor").debug(" Updated outside sensor data.")
Exemplo n.º 10
0
def save_outside_reading(temp, humid):
    add_reading_to_dequeue(OUT_Temp_Q, temp)
    add_reading_to_dequeue(OUT_Humid_Q, humid)

    now = Now.get()

    now.Out_Temp = sum(OUT_Temp_Q['Q']) / float(len(OUT_Temp_Q['Q']))
    now.Out_Humid = sum(OUT_Humid_Q['Q']) / float(len(OUT_Humid_Q['Q']))

    logging.getLogger("sensor").debug(" Updated outside sensor data.")
Exemplo n.º 11
0
def save_system_reading(cpu, ram):
    now = Now.get()
    now.System_CPU = cpu
    now.System_RAM = ram
    
    logging.getLogger("sensor").debug(" Updated SYSTEM data.")
Exemplo n.º 12
0
def save_system_reading(cpu, ram):
    now = Now.get()
    now.System_CPU = cpu
    now.System_RAM = ram

    logging.getLogger("sensor").debug(" Updated SYSTEM data.")