Skip to content

Commit

Permalink
changes per review comments and removed resulting unused TYPES
Browse files Browse the repository at this point in the history
  • Loading branch information
tcfranks committed Sep 28, 2022
1 parent 536015c commit 6d2767f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions adafruit_ds2413.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
from adafruit_onewire.device import OneWireDevice

try:
from typing import Union
import typing # pylint: disable=unused-import
from typing_extensions import Literal
from adafruit_onewire.bus import OneWireBus # pylint: disable=ungrouped-imports
from microcontroller import Pin
except ImportError:
pass

Expand Down Expand Up @@ -71,7 +70,7 @@ def value(self) -> bool:
return not self._host.pio_state & (self._mask << self._direction)

@value.setter
def value(self, state: Union[bool, Literal[0, 1]]) -> None:
def value(self, state: bool) -> None:
# This only makes sense if the pin is configured for OUTPUT.
if self._direction == INPUT:
raise RuntimeError("Can't set value when pin is set to input.")
Expand Down Expand Up @@ -105,14 +104,14 @@ def __init__(self, bus: OneWireBus, address: int) -> None:
raise RuntimeError("Incorrect family code in device address.")

@property
def IOA(self) -> Pin:
def IOA(self) -> DS2413Pin:
"""The pin object for channel A."""
if self._IOA is None:
self._IOA = DS2413Pin(0, self)
return self._IOA

@property
def IOB(self) -> Pin:
def IOB(self) -> DS2413Pin:
"""The pin object for channel B."""
if self._IOB is None:
self._IOB = DS2413Pin(1, self)
Expand Down

0 comments on commit 6d2767f

Please sign in to comment.