Skip to content

Commit

Permalink
Avoid pin lock, release immediately after creation. (#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail authored Oct 19, 2024
1 parent f23f952 commit ccb49eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions octoprint_octorelay/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def __init__(self, pin: int, inverted: bool, pin_factory=None):
self.pin = pin # GPIO pin
self.inverted = inverted # marks the relay as normally closed
self.handle = LED(pin, pin_factory=pin_factory, initial_value=inverted)
# release immediately, avoid lock, allow physical buttons to operate same relays:
self.handle.pin_factory.release_pins(self.handle, self.pin)

def __repr__(self) -> str:
return f"{type(self).__name__}(pin={self.pin},inverted={self.inverted},closed={self.is_closed()})"
Expand Down

0 comments on commit ccb49eb

Please sign in to comment.