Skip to content

Commit

Permalink
Forcing active_low to operate inverted relays within the driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinTail committed May 19, 2024
1 parent ada3ff4 commit 154524e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion octoprint_octorelay/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, pin: int, inverted: bool):
"/dev/gpiochip0",
consumer = "OctoRelay",
config = {
pin: LineSettings(direction=Direction.OUTPUT)
pin: LineSettings(direction=Direction.OUTPUT, active_low=False)
}
)
self.pin = pin # GPIO pin
Expand Down
2 changes: 1 addition & 1 deletion tests/test_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_constructor(self):
self.assertIsInstance(relay, Relay)
self.assertEqual(relay.pin, 18)
self.assertTrue(relay.inverted)
gpiod_mock.LineSettings.assert_called_with(direction="OutputMock")
gpiod_mock.LineSettings.assert_called_with(direction="OutputMock", active_low=False)
gpiod_mock.request_lines.assert_called_with(
"/dev/gpiochip0",
consumer = "OctoRelay",
Expand Down

0 comments on commit 154524e

Please sign in to comment.