Skip to content

Commit 6d2767f

Browse files
committed
changes per review comments and removed resulting unused TYPES
1 parent 536015c commit 6d2767f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

adafruit_ds2413.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@
1919
from adafruit_onewire.device import OneWireDevice
2020

2121
try:
22-
from typing import Union
22+
import typing # pylint: disable=unused-import
2323
from typing_extensions import Literal
2424
from adafruit_onewire.bus import OneWireBus # pylint: disable=ungrouped-imports
25-
from microcontroller import Pin
2625
except ImportError:
2726
pass
2827

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

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

107106
@property
108-
def IOA(self) -> Pin:
107+
def IOA(self) -> DS2413Pin:
109108
"""The pin object for channel A."""
110109
if self._IOA is None:
111110
self._IOA = DS2413Pin(0, self)
112111
return self._IOA
113112

114113
@property
115-
def IOB(self) -> Pin:
114+
def IOB(self) -> DS2413Pin:
116115
"""The pin object for channel B."""
117116
if self._IOB is None:
118117
self._IOB = DS2413Pin(1, self)

0 commit comments

Comments
 (0)