Skip to content

Commit 02ecadf

Browse files
committed
fix: resolve issues identified by pylint
1 parent 420a5ae commit 02ecadf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

feeph/i2cmux/generic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def __init__(self, i2c_bus: busio.I2C, i2c_adr: int, tca_adr: int, tca_cid: int,
4343
# this a low-level class and should not be used directly
4444
# specific implementations should be derive from this class and
4545
# they are expected to perform all necessary input validation
46-
self._i2c_bus = i2c_bus
47-
self._i2c_adr = i2c_adr
46+
super().__init__(i2c_bus=i2c_bus, i2c_adr=i2c_adr)
47+
self._channel_switch = bytearray()
4848
self._tca_adr = tca_adr
4949
self._tca_cid = tca_cid
5050
self._timeout_ms = timeout_ms
@@ -79,8 +79,8 @@ def __enter__(self) -> BurstHandle:
7979
# successfully acquired a lock
8080
# -----------------------------------------------------------------
8181
# send I²C command to configure the correct channel
82-
self.channel_switch = bytearray([1 << self._tca_cid])
83-
self._i2c_bus.writeto(self._tca_adr, self.channel_switch)
82+
self._channel_switch = bytearray([1 << self._tca_cid])
83+
self._i2c_bus.writeto(self._tca_adr, self._channel_switch)
8484
# -----------------------------------------------------------------
8585
elapsed_ns = time.perf_counter_ns() - self._timestart_ns
8686
LH.debug("[%d] Acquired a lock on the I²C bus after %d ms.", id(self), elapsed_ns / (1000 * 1000))

0 commit comments

Comments
 (0)