Skip to content

Commit c245b5f

Browse files
authored
Merge pull request #6 from BZab/main
INA3221 init: add probe parameter
2 parents c1a7316 + c661e17 commit c245b5f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

adafruit_ina3221.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,17 @@ def summation_channel(self, value: bool) -> None:
278278
class INA3221:
279279
"""Driver for the INA3221 device with three channels."""
280280

281-
def __init__(self, i2c, address: int = DEFAULT_ADDRESS, enable: List = [0, 1, 2]) -> None:
281+
def __init__(
282+
self, i2c, address: int = DEFAULT_ADDRESS, enable: List = [0, 1, 2], probe: bool = True
283+
) -> None:
282284
"""Initializes the INA3221 class over I2C
283285
Args:
284286
i2c (I2C): The I2C bus to which the INA3221 is connected.
285287
address (int, optional): The I2C address of the INA3221. Defaults to DEFAULT_ADDRESS.
286288
enable(List[int], optional): channels to initialize at start (default: all)
289+
probe (bool, optiona): Probe for the device upon object creation, default is true
287290
"""
288-
self.i2c_dev = I2CDevice(i2c, address)
291+
self.i2c_dev = I2CDevice(i2c, address, probe=probe)
289292
self.reset()
290293

291294
self.channels: List[INA3221Channel] = [INA3221Channel(self, i) for i in range(3)]

0 commit comments

Comments
 (0)