Skip to content

Commit c29c339

Browse files
committed
added Iterable and other changes per review comments
1 parent 3277c45 commit c29c339

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_lps2x.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from adafruit_register.i2c_bit import RWBit
4242

4343
try:
44-
from typing import Optional, Tuple, Union
44+
from typing import Iterable, Optional, Tuple
4545
from typing_extensions import Literal
4646
from busio import I2C
4747
except ImportError:
@@ -81,7 +81,9 @@ class CV:
8181
"""struct helper"""
8282

8383
@classmethod
84-
def add_values(cls, value_tuples: Tuple[str, int, float, Union[str, None]]) -> None:
84+
def add_values(
85+
cls, value_tuples: Iterable[Tuple[str, int, Optional[float], Optional[float]]]
86+
) -> None:
8587
"""creates CV entries"""
8688
cls.string = {}
8789
cls.lsb = {}
@@ -149,8 +151,8 @@ class LPS2X: # pylint: disable=too-many-instance-attributes
149151
def __init__(
150152
self,
151153
i2c_bus: I2C,
152-
address: Literal[0x5C, 0x5D] = _LPS2X_DEFAULT_ADDRESS,
153-
chip_id: Optional[Literal[0xB1, 0xBD]] = None,
154+
address: int = _LPS2X_DEFAULT_ADDRESS,
155+
chip_id: Optional[int] = None,
154156
) -> None:
155157
self.i2c_device = i2cdevice.I2CDevice(i2c_bus, address)
156158
if not self._chip_id in [chip_id]:

0 commit comments

Comments
 (0)