We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 062a43e + 1cb6a9e commit cece54dCopy full SHA for cece54d
adafruit_ina219.py
@@ -37,10 +37,7 @@
37
38
from busio import I2C
39
except ImportError:
40
- # define I2C to avoid the error:
41
- # def __init__(self, i2c_bus: I2C, addr: int = 0x40) -> None:
42
- # NameError: name 'I2C' is not defined
43
- I2C = None
+ pass
44
45
__version__ = "0.0.0+auto.0"
46
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_INA219.git"
@@ -153,7 +150,7 @@ class INA219:
153
150
# raw_current RO : Current register (not scaled)
154
151
# calibration RW : calibration register (note: value is cached)
155
152
156
- def __init__(self, i2c_bus: I2C, addr: int = 0x40) -> None:
+ def __init__(self, i2c_bus: "I2C", addr: int = 0x40) -> None:
157
self.i2c_device = I2CDevice(i2c_bus, addr)
158
self.i2c_addr = addr
159
0 commit comments