Skip to content

Commit ea44839

Browse files
committed
INA3221 init: add probe parameter
1 parent c1a7316 commit ea44839

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adafruit_ina3221.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,15 @@ 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__(self, i2c, address: int = DEFAULT_ADDRESS, enable: List = [0, 1, 2], probe: bool = True) -> None:
282282
"""Initializes the INA3221 class over I2C
283283
Args:
284284
i2c (I2C): The I2C bus to which the INA3221 is connected.
285285
address (int, optional): The I2C address of the INA3221. Defaults to DEFAULT_ADDRESS.
286286
enable(List[int], optional): channels to initialize at start (default: all)
287+
probe (bool, optiona): Probe for the device upon object creation, default is true
287288
"""
288-
self.i2c_dev = I2CDevice(i2c, address)
289+
self.i2c_dev = I2CDevice(i2c, address, probe=probe)
289290
self.reset()
290291

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

0 commit comments

Comments
 (0)