Skip to content

Commit a78092f

Browse files
committed
add backwards compatibility
1 parent c662ff9 commit a78092f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

adafruit_tca9548a.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ def scan(self) -> List[int]:
100100

101101
def probe(self, address: int) -> bool:
102102
"""Check if an I2C device is at the specified address on the hub."""
103-
return self.tca.i2c.probe(address)
103+
# backwards compatibility for circuitpython <9.2
104+
if hasattr(self.tca.i2c, "probe"):
105+
return self.tca.i2c.probe(address)
106+
return address in self.scan()
104107

105108

106109
class TCA9548A:

0 commit comments

Comments
 (0)