Skip to content

Commit

Permalink
made changes per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tcfranks committed Sep 26, 2022
1 parent 502f8cb commit aa613c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions adafruit_lc709203f.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
from adafruit_bus_device import i2c_device

try:
from typing import Tuple, Union
from typing import Iterable, Optional, Tuple, Union
from typing_extensions import Literal
from circuitpython_typing import ReadableBuffer
from busio import I2C
Expand All @@ -63,7 +63,9 @@ class CV:
"""struct helper"""

@classmethod
def add_values(cls, value_tuples: Tuple[str, int, str, Union[int, None]]) -> None:
def add_values(
cls, value_tuples: Iterable[Tuple[str, int, str, Optional[float]]]
) -> None:
"""Add CV values to the class"""
cls.string = {}
cls.lsb = {}
Expand Down Expand Up @@ -211,7 +213,7 @@ def thermistor_enable(self) -> int:
@thermistor_enable.setter
def thermistor_enable(self, status: Union[Literal[0, 1], bool]) -> None:
"""Sets the temperature source to Tsense"""
if not status in (True, False):
if not isinstance(status, bool):
raise AttributeError("thermistor_enable must be True or False")
self._write_word(LC709203F_CMD_STATUSBIT, status)

Expand Down

0 comments on commit aa613c8

Please sign in to comment.