Open gouldner opened 4 years ago
Hi, I had the same issue and this fixed it, thanks for posting.
There is still a moment (although more brief now) that the output would be toggled. better solution: change: GPIO.setup(self.relay_pin, GPIO.OUT) to: GPIO.setup(self.relay_pin, GPIO.OUT, initial=self.invert_relay) to properly set the initial state on output setup.
I created a new pull request with this change.
I fixed the issue I was reporting ( https://github.com/Jerrkawz/GarageQTPi/issues/35 ) and wanted to share my solution.
I found that the call to GPIO.setup(self.relay_pin, GPIO.OUT) starts with the GPIO sending the signal to the relay and turns off a few lines down when GPIO.output(self.relay_pin, self.invert_relay) is called.
So I moved GPIO.output(self.relay_pin, self.invert_relay) right after the setup and the trigger no longer happens.