Beispiel #1
0
    def high_temp_handler(self, payload):
        print("\nHigh temp state reached")
        heaters = Relay.load_by_name("AquaOne 100W")
        heaters[0].off()

        heaters = Relay.load_by_name("AquaOne 50W")
        heaters[0].off()

        fans = Relay.load_by_name("Refugium Fan")
        fans[0].off()
Beispiel #2
0
    def low_temp_critical_handler(self, payload):
        print("\nLow(Critical) temp state reached")

        heaters = Relay.load_by_name("AquaOne 100W")
        heaters[0].on()

        heaters = Relay.load_by_name("AquaOne 50W")
        heaters[0].on()

        fans = Relay.load_by_name("Refugium Fan")
        fans[0].off()
Beispiel #3
0
def manage_relay_by_name(device_name, desired_state):

    relays = Relay.load_by_name(device_name)

    if len(relays) == 0:
        exit("No devices found with that name")

    for x in relays:
        if desired_state == "on":
            x.on()
        else:
            x.off()
Beispiel #4
0
def manage_relay_by_type(device_type, desired_state):
    
    relays = Relay.load_by_type(device_type)

    if len(relays) == 0:
        exit("No devices of that type found")

    for x in relays:
        if desired_state == "on":
            x.on()
        else:
            x.off()