Skip to content

Commit 65bfe66

Browse files
committed
Addressing PR comments
1 parent 5ca81ee commit 65bfe66

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

adafruit_ads1x15/ads1015.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Author(s): Carter Nelson
1212
"""
1313
import struct
14+
from typing import Dict, List
1415

1516
# pylint: disable=unused-import
1617
from .ads1x15 import ADS1x15, Mode
@@ -46,14 +47,14 @@ def bits(self) -> int:
4647
return 12
4748

4849
@property
49-
def rates(self) -> list[int]:
50+
def rates(self) -> List[int]:
5051
"""Possible data rate settings."""
5152
r = list(_ADS1015_CONFIG_DR.keys())
5253
r.sort()
5354
return r
5455

5556
@property
56-
def rate_config(self) -> dict[int, int]:
57+
def rate_config(self) -> Dict[int, int]:
5758
"""Rate configuration masks."""
5859
return _ADS1015_CONFIG_DR
5960

adafruit_ads1x15/ads1115.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* Author(s): Carter Nelson
1212
"""
1313
import struct
14+
from typing import Dict, List
1415

1516
# pylint: disable=unused-import
1617
from .ads1x15 import ADS1x15, Mode
@@ -47,14 +48,14 @@ def bits(self) -> int:
4748
return 16
4849

4950
@property
50-
def rates(self) -> list[int]:
51+
def rates(self) -> List[int]:
5152
"""Possible data rate settings."""
5253
r = list(_ADS1115_CONFIG_DR.keys())
5354
r.sort()
5455
return r
5556

5657
@property
57-
def rate_config(self) -> dict[int, int]:
58+
def rate_config(self) -> Dict[int, int]:
5859
"""Rate configuration masks."""
5960
return _ADS1115_CONFIG_DR
6061

adafruit_ads1x15/ads1x15.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from micropython import const
2121

2222
try:
23-
from typing import Optional
23+
from typing import Optional, List, Dict
2424

2525
from busio import I2C
2626
from microcontroller import Pin
@@ -103,12 +103,12 @@ def data_rate(self, rate: int) -> None:
103103
self._data_rate = rate
104104

105105
@property
106-
def rates(self) -> list[int]:
106+
def rates(self) -> List[int]:
107107
"""Possible data rate settings."""
108108
raise NotImplementedError("Subclass must implement rates property.")
109109

110110
@property
111-
def rate_config(self) -> dict[int, int]:
111+
def rate_config(self) -> Dict[int, int]:
112112
"""Rate configuration masks."""
113113
raise NotImplementedError("Subclass must implement rate_config property.")
114114

@@ -125,7 +125,7 @@ def gain(self, gain: float) -> None:
125125
self._gain = gain
126126

127127
@property
128-
def gains(self) -> list[float]:
128+
def gains(self) -> List[float]:
129129
"""Possible gain settings."""
130130
g = list(_ADS1X15_CONFIG_GAIN.keys())
131131
g.sort()

0 commit comments

Comments
 (0)