Example #1
0
    def __init__(self, relayPin=None, sensorPin=None):

        if relayPin:
            Logger.logit("Setting up a relay")
            self.relay = Relay(relayPin)
        if sensorPin:
            Logger.logit("Setting up a sensor")
            self.sensor = Sensor(sensorPin)
Example #2
0
 def turn_off(self):
     Logger.logit("Turning " + self.name + " off")
     GPIO.output(self.pin, GPIO.HIGH)
     self.state = 0
Example #3
0
 def turn_on(self):
     Logger.logit("Turning " + self.name + " on")
     GPIO.output(self.pin, GPIO.LOW)
     self.state = 1