From fde1a5262454ac86c0144b5f650ddb27bd6c3d07 Mon Sep 17 00:00:00 2001 From: Ronald Gouldner Date: Sat, 25 Jan 2020 02:00:25 -1000 Subject: [PATCH] fix boot trigger of relay --- lib/garage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/garage.py b/lib/garage.py index 3c7f1aa..69f78a2 100644 --- a/lib/garage.py +++ b/lib/garage.py @@ -29,12 +29,12 @@ def __init__(self, config): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(self.relay_pin, GPIO.OUT) + # Set default relay state to false (off) + GPIO.output(self.relay_pin, self.invert_relay) GPIO.setup(self.state_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.add_event_detect(self.state_pin, GPIO.BOTH, callback=self.__stateChanged, bouncetime=300) - # Set default relay state to false (off) - GPIO.output(self.relay_pin, self.invert_relay) # Release rpi resources def __del__(self):