Skip to content

Commit 5026e79

Browse files
authored
Update existing annotations
1 parent 334a5d9 commit 5026e79

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

adafruit_pcf8591/analog_in.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
try:
3131
import typing # pylint: disable=unused-import
32+
from typing_extensions import Literal
3233
from adafruit_pcf8591.pcf8591 import PCF8591
3334
except ImportError:
3435
pass
@@ -37,11 +38,11 @@
3738
class AnalogIn:
3839
"""AnalogIn Mock Implementation for ADC Reads."""
3940

40-
def __init__(self, pcf: PCF8591, pin: int) -> None:
41+
def __init__(self, pcf: PCF8591, pin: Literal[0, 1, 2, 3]) -> None:
4142
"""AnalogIn
4243
4344
:param pcf: The PCF8591 object.
44-
:param int pin: Required ADC channel pin.
45+
:param int pin: Required ADC channel pin; must be 0-3 inclusive
4546
4647
"""
4748
self._pcf = pcf

adafruit_pcf8591/analog_out.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"""
2929
try:
3030
import typing # pylint: disable=unused-import
31+
from typing_extensions import Literal
3132
from adafruit_pcf8591.pcf8591 import PCF8591
3233
except ImportError:
3334
pass
@@ -36,11 +37,11 @@
3637
class AnalogOut:
3738
"""AnalogIn Mock Implementation for ADC Reads."""
3839

39-
def __init__(self, pcf: PCF8591, dac_pin: int = 0) -> None:
40+
def __init__(self, pcf: PCF8591, dac_pin: Literal[0] = 0) -> None:
4041
"""AnalogIn
4142
4243
:param pcf: The pcf object.
43-
:param int pin: Required pin must be adafruit_pcf8591.pcf8591.A0
44+
:param int dac_pin: Required pin must be adafruit_pcf8591.pcf8591.A0
4445
4546
"""
4647
self._pcf = pcf

0 commit comments

Comments
 (0)