Exemplo n.º 1
0
def set_relay_state_based_on_temps():
    set_temp = get_set_temp()
    current_temp = get_current_temp()
    print "Set temp is {0} and current temp is {1}".format(set_temp, current_temp)
    desired_relay_state = 0

    if current_temp >= set_temp + upper_temp_slop:
        desired_relay_state = 0

    if current_temp <= set_temp - lower_temp_slop:
        desired_relay_state = 1

    relay_state = get_relay_state()
    if relay_state != desired_relay_state:
        relay_state = desired_relay_state
        set_relay_state(relay_state)
        print "*** Change relay to {0} ***".format(relay_state)
Exemplo n.º 2
0
def set_relay_state_based_on_temps():
    set_temp = get_set_temp()
    current_temp = get_current_temp()
    log_data("setTemp: {0}, currentTemp: {1}".format(set_temp, current_temp))
    desired_relay_state = 0

    if current_temp >= set_temp + upper_temp_slop:
        desired_relay_state = 0

    if current_temp <= set_temp - lower_temp_slop:
        desired_relay_state = 1

    relay_state = get_relay_state()
    if relay_state != desired_relay_state:
        relay_state = desired_relay_state
        set_relay_state(relay_state)
        log_info("*** Change relay to {1} ***".format(relay_state))
Exemplo n.º 3
0
def copy_current_temp():
    current_temp = get_current_temp()
    written_temp = write_current_temp(current_temp)
    return written_temp