def relay_off(relay_num): """Turn a relay off.""" relays.set_state(int(relay_num), "off") return "Relay %s turned OFF" % relay_num
def relay_on(relay_num): """Turn a relay on.""" relays.set_state(int(relay_num), "on") return "Relay %s turned ON" % relay_num
def cool(): """Set system to cool.""" relays.set_state(relays.RELAY_HEAT, "off") relays.set_state(relays.RELAY_AC, "on") if DEBUG: print("AC turned on")
def off(): """Turn system off.""" relays.set_state(relays.RELAY_HEAT, "off") relays.set_state(relays.RELAY_AC, "off") if DEBUG: print("HVAC turned off")
def heat(): """Set system to heat.""" relays.set_state(relays.RELAY_AC, "off") relays.set_state(relays.RELAY_HEAT, "on") if DEBUG: print("Heat turned on")