Skip to content

Commit 4464578

Browse files
committed
game of lint
1 parent 8f6d733 commit 4464578

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

adafruit_mcp230xx/mcp23008.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,20 @@
3737
__version__ = "0.0.0-auto.0"
3838
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx.git"
3939

40+
# pylint: disable=bad-whitespace
4041
_MCP23008_ADDRESS = const(0x20)
4142
_MCP23008_IODIR = const(0x00)
4243
_MCP23008_GPPU = const(0x06)
4344
_MCP23008_GPIO = const(0x09)
4445

4546

4647
class MCP23008(MCP230XX):
47-
"""Initialize MCP23008 instance on specified I2C bus and optionally
48+
"""Supports MCP23008 instance on specified I2C bus and optionally
4849
at the specified I2C address.
4950
"""
5051

5152
def __init__(self, i2c, address=_MCP23008_ADDRESS):
52-
self._device = i2c_device.I2CDevice(i2c, address)
53+
super().__init__(i2c, address)
5354
# Reset device state to all pins as inputs (safest option).
5455
with self._device as device:
5556
# Write to MCP23008_IODIR register 0xFF followed by 9 zeros

adafruit_mcp230xx/mcp23017.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
__version__ = "0.0.0-auto.0"
3838
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx.git"
3939

40+
# pylint: disable=bad-whitespace
4041
_MCP23017_ADDRESS = const(0x20)
4142
_MCP23017_IODIRA = const(0x00)
4243
_MCP23017_IODIRB = const(0x01)
@@ -52,12 +53,12 @@
5253

5354

5455
class MCP23017(MCP230XX):
55-
"""Initialize MCP23017 instance on specified I2C bus and optionally
56+
"""Supports MCP23017 instance on specified I2C bus and optionally
5657
at the specified I2C address.
5758
"""
5859

5960
def __init__(self, i2c, address=_MCP23017_ADDRESS):
60-
self._device = i2c_device.I2CDevice(i2c, address)
61+
super().__init__(i2c, address)
6162
# Reset to all inputs with no pull-ups and no inverted polarity.
6263
self.iodir = 0xFFFF
6364
self.gppu = 0x0000

adafruit_mcp230xx/mcp230xx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
_BUFFER = bytearray(3)
3939

4040
class MCP230XX:
41+
"""Base class for MCP230xx devices."""
42+
43+
def __init__(self, i2c, address):
44+
self._device = i2c_device.I2CDevice(i2c, address)
4145

4246
def _read_u16le(self, register):
4347
# Read an unsigned 16 bit little endian value from the specified 8-bit

0 commit comments

Comments
 (0)