Skip to content

Commit 2c7c55e

Browse files
committed
Restore necessary kwargs to DigitalInOut facade classes.
1 parent 8c9755d commit 2c7c55e

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

adafruit_character_lcd/mcp23008.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,21 @@ def __init__(self, pin_number, mcp23008):
5050
self._pin = pin_number
5151
self._mcp = mcp23008
5252

53-
def switch_to_output(self, value=False):
53+
# kwargs in switch functions below are _necessary_ for compatibility
54+
# with DigitalInout class (which allows specifying pull, etc. which
55+
# is unused by this class). Do not remove them, instead turn off pylint
56+
# in this case.
57+
#pylint: disable=unused-argument
58+
def switch_to_output(self, value=False, **kwargs):
5459
"""DigitalInOut switch_to_output"""
5560
self.direction = digitalio.Direction.OUTPUT
5661
self.value = value
5762

58-
def switch_to_input(self, pull=None):
63+
def switch_to_input(self, pull=None, **kwargs):
5964
"""DigitalInOut switch_to_input"""
6065
self.direction = digitalio.Direction.INPUT
6166
self.pull = pull
67+
#pylint: enable=unused-argument
6268

6369
@property
6470
def value(self):

adafruit_character_lcd/shift_reg_74hc595.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import adafruit_bus_device.spi_device as spi_device
1212

13+
1314
#pylint: disable-msg=too-few-public-methods
1415
#pylint: disable-msg=no-self-use
1516
class ShiftReg74HC595:
@@ -28,14 +29,20 @@ def __init__(self, pin_number, shift_reg_74ls595):
2829
self._pin = pin_number
2930
self._sr = shift_reg_74ls595
3031

31-
def switch_to_output(self, value=False):
32+
# kwargs in switch functions below are _necessary_ for compatibility
33+
# with DigitalInout class (which allows specifying pull, etc. which
34+
# is unused by this class). Do not remove them, instead turn off pylint
35+
# in this case.
36+
#pylint: disable=unused-argument
37+
def switch_to_output(self, value=False, **kwargs):
3238
"""DigitalInOut switch_to_output"""
3339
self.direction = digitalio.Direction.OUTPUT
3440
self.value = value
3541

36-
def switch_to_input(self):
42+
def switch_to_input(self, **kwargs):
3743
"""do not call switch_to_input"""
3844
raise RuntimeError('Unable to use 74HC595 as digital input!')
45+
#pylint: enable=unused-argument
3946

4047
@property
4148
def value(self):

0 commit comments

Comments
 (0)