Skip to content

Commit 8ff53ab

Browse files
committed
changes per review comments
1 parent 0a47556 commit 8ff53ab

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adafruit_mcp4728.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from adafruit_bus_device import i2c_device
3434

3535
try:
36-
from typing import Dict, Iterable, List, Optional, Tuple
36+
from typing import Dict, Iterable, Iterator, List, Optional, Tuple
3737
from typing_extensions import Literal
3838
from busio import I2C
3939
except ImportError:
@@ -178,7 +178,7 @@ def save_settings(self) -> None:
178178
self._write_multi_eeprom(byte_list)
179179

180180
# TODO: add the ability to set an offset
181-
def _write_multi_eeprom(self, byte_list) -> None:
181+
def _write_multi_eeprom(self, byte_list: List[int]) -> None:
182182
buffer_list = [_MCP4728_CH_A_MULTI_EEPROM]
183183
buffer_list += byte_list
184184

@@ -217,7 +217,7 @@ def sync_gains(self) -> None:
217217
with self.i2c_device as i2c:
218218
i2c.write(buf)
219219

220-
def _set_value(self, channel: int) -> None:
220+
def _set_value(self, channel: "Channel") -> None:
221221

222222
channel_bytes = self._generate_bytes_with_flags(channel)
223223

@@ -241,7 +241,7 @@ def _generate_bytes_with_flags(channel: "Channel") -> bytearray:
241241
return buf
242242

243243
@staticmethod
244-
def _chunk(big_list: bytearray, chunk_size: int) -> bytearray:
244+
def _chunk(big_list: bytearray, chunk_size: int) -> Iterator[bytearray]:
245245
"""Divides a given list into `chunk_size` sized chunks"""
246246
for i in range(0, len(big_list), chunk_size):
247247
yield big_list[i : i + chunk_size]

0 commit comments

Comments
 (0)