Пример #1
0
def relay_off(relay_num):
    """Turn a relay off."""
    relays.set_state(int(relay_num), "off")
    return "Relay %s turned OFF" % relay_num
Пример #2
0
def relay_on(relay_num):
    """Turn a relay on."""
    relays.set_state(int(relay_num), "on")
    return "Relay %s turned ON" % relay_num
Пример #3
0
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")
Пример #4
0
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")
Пример #5
0
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")