Skip to content

Commit 940ff56

Browse files
committed
Correct Missing Type Annotations
1 parent d32574a commit 940ff56

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_ina260.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# imports
2222

2323
try:
24+
import typing # pylint: disable=unused-import
2425
from board import I2C
2526
except ImportError:
2627
pass
@@ -169,11 +170,11 @@ class INA260:
169170
"""Driver for the INA260 power and current sensor.
170171
171172
:param ~busio.I2C i2c_bus: The I2C bus the INA260 is connected to.
172-
:param address: The I2C device address for the sensor. Default is ``0x40``.
173+
:param address int: The I2C device address for the sensor. Default is ``0x40``.
173174
174175
"""
175176

176-
def __init__(self, i2c_bus: I2C(), address: int = 0x40) -> None:
177+
def __init__(self, i2c_bus: board.I2C, address: int = 0x40) -> None:
177178
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
178179

179180
if self._manufacturer_id != self.TEXAS_INSTRUMENT_ID:
@@ -300,7 +301,7 @@ def voltage(self) -> float:
300301
return self._raw_voltage * 0.00125
301302

302303
@property
303-
def power(self) -> float:
304+
def power(self) -> int:
304305
"""The power being delivered to the load in mW"""
305306
if self.mode == Mode.TRIGGERED:
306307
while self._conversion_ready_flag == 0:

0 commit comments

Comments
 (0)