Skip to content

Commit f70e5c1

Browse files
committed
fix __init__
1 parent 2a9f7e2 commit f70e5c1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_tca9548a.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,21 @@ class TCA9547D_Channel(TCA9548A_Channel):
143143
behave like an I2CDevice."""
144144

145145
def __init__(self, tca: "TCA9547D", channel: int) -> None:
146+
super().__init__(tca, channel)
146147
self.tca = tca
147148
"""
148149
B3 enables/disables the mux. B2-B0 control which channel is used.
149150
ref: https://www.nxp.com/docs/en/data-sheet/PCA9547.pdf
150151
"""
151-
self.channel_switch = (channel + (1<<3)).to_bytes(1, "little")
152+
self.channel_switch = (channel + (1 << 3)).to_bytes(1, "little")
152153

153154

154155
class TCA9547D(TCA9548A):
155156
"""Class which provides interface to TCA9547D I2C multiplexer."""
156157

158+
def __init__(self, i2c: I2C, address: int = _DEFAULT_ADDRESS) -> None:
159+
super().__init__(i2c, address)
160+
157161
def __getitem__(self, key: Literal[0, 1, 2, 3, 4, 5, 6, 7]) -> "TCA9548A_Channel":
158162
if not 0 <= key <= 7:
159163
raise IndexError("Channel must be an integer in the range: 0-7.")

0 commit comments

Comments
 (0)