Skip to content

Commit 898a7b1

Browse files
author
caternuson
committed
pylint
1 parent 0f6da4e commit 898a7b1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

adafruit_tca9548a.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,20 +60,24 @@ def __init__(self, tca, channel):
6060
self.channel_switch = bytearray([1 << channel])
6161

6262
def try_lock(self):
63+
"""Pass thru for try_lock."""
6364
while not self.tca.i2c.try_lock():
6465
pass
6566
self.tca.i2c.writeto(self.tca.address, self.channel_switch)
6667
return True
6768

6869
def unlock(self):
70+
"""Pass thru for unlock."""
6971
return self.tca.i2c.unlock()
7072

7173
def readfrom_into(self, address, buffer, **kwargs):
74+
"""Pass thru for readfrom_into."""
7275
if address == self.tca.address:
7376
raise ValueError("Device address must be different than TCA9548A address.")
7477
return self.tca.i2c.readfrom_into(address, buffer, **kwargs)
7578

7679
def writeto(self, address, buffer, **kwargs):
80+
"""Pass thru for writeto."""
7781
if address == self.tca.address:
7882
raise ValueError("Device address must be different than TCA9548A address.")
7983
return self.tca.i2c.writeto(address, buffer, **kwargs)
@@ -83,7 +87,7 @@ class TCA9548A():
8387
"""Class which provides interface to TCA9548A I2C multiplexer."""
8488

8589
def __init__(self, i2c, address=_DEFAULT_ADDRESS):
86-
self.i2c = i2c
90+
self.i2c = i2c
8791
self.address = address
8892
self.used_channels = []
8993

@@ -93,4 +97,4 @@ def __getitem__(self, key):
9397
if key in self.used_channels:
9498
raise ValueError("Channel already in use.")
9599
self.used_channels.append(key)
96-
return TCA9548A_Channel(self, key)
100+
return TCA9548A_Channel(self, key)

0 commit comments

Comments
 (0)