diff --git a/octoprint_octorelay/driver.py b/octoprint_octorelay/driver.py index b55b9b98..1d01f8e7 100644 --- a/octoprint_octorelay/driver.py +++ b/octoprint_octorelay/driver.py @@ -11,9 +11,7 @@ def __init__(self, pin: int, inverted: bool): self.request = request_lines( "/dev/gpiochip0", consumer = "OctoRelay", - config = { - pin: LineSettings(direction=Direction.OUTPUT, active_low=False) - } + config = { pin: LineSettings(direction=Direction.AS_IS) } ) self.pin = pin # GPIO pin self.inverted = inverted # marks the relay as normally closed diff --git a/tests/test_driver.py b/tests/test_driver.py index e208036f..4ffc9702 100644 --- a/tests/test_driver.py +++ b/tests/test_driver.py @@ -11,7 +11,7 @@ sys.modules["gpiod"] = gpiod_mock gpiod_line_mock = Mock() gpiod_line_mock.Direction = Mock() -gpiod_line_mock.Direction.OUTPUT = "OutputMock" +gpiod_line_mock.Direction.AS_IS = "AsIsMock" gpiod_line_mock.Value = Mock() gpiod_line_mock.Value.ACTIVE = "ActiveMock" gpiod_line_mock.Value.INACTIVE = "InactiveMock" @@ -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", active_low=False) + gpiod_mock.LineSettings.assert_called_with(direction="AsIsMock") gpiod_mock.request_lines.assert_called_with( "/dev/gpiochip0", consumer = "OctoRelay",