コード例 #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'])
コード例 #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'])
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")
コード例 #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.")