@@ -60,20 +60,24 @@ def __init__(self, tca, channel):
60
60
self .channel_switch = bytearray ([1 << channel ])
61
61
62
62
def try_lock (self ):
63
+ """Pass thru for try_lock."""
63
64
while not self .tca .i2c .try_lock ():
64
65
pass
65
66
self .tca .i2c .writeto (self .tca .address , self .channel_switch )
66
67
return True
67
68
68
69
def unlock (self ):
70
+ """Pass thru for unlock."""
69
71
return self .tca .i2c .unlock ()
70
72
71
73
def readfrom_into (self , address , buffer , ** kwargs ):
74
+ """Pass thru for readfrom_into."""
72
75
if address == self .tca .address :
73
76
raise ValueError ("Device address must be different than TCA9548A address." )
74
77
return self .tca .i2c .readfrom_into (address , buffer , ** kwargs )
75
78
76
79
def writeto (self , address , buffer , ** kwargs ):
80
+ """Pass thru for writeto."""
77
81
if address == self .tca .address :
78
82
raise ValueError ("Device address must be different than TCA9548A address." )
79
83
return self .tca .i2c .writeto (address , buffer , ** kwargs )
@@ -83,7 +87,7 @@ class TCA9548A():
83
87
"""Class which provides interface to TCA9548A I2C multiplexer."""
84
88
85
89
def __init__ (self , i2c , address = _DEFAULT_ADDRESS ):
86
- self .i2c = i2c
90
+ self .i2c = i2c
87
91
self .address = address
88
92
self .used_channels = []
89
93
@@ -93,4 +97,4 @@ def __getitem__(self, key):
93
97
if key in self .used_channels :
94
98
raise ValueError ("Channel already in use." )
95
99
self .used_channels .append (key )
96
- return TCA9548A_Channel (self , key )
100
+ return TCA9548A_Channel (self , key )
0 commit comments