File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 11
11
* Author(s): Carter Nelson
12
12
"""
13
13
import struct
14
+ from typing import Dict , List
14
15
15
16
# pylint: disable=unused-import
16
17
from .ads1x15 import ADS1x15 , Mode
@@ -46,14 +47,14 @@ def bits(self) -> int:
46
47
return 12
47
48
48
49
@property
49
- def rates (self ) -> list [int ]:
50
+ def rates (self ) -> List [int ]:
50
51
"""Possible data rate settings."""
51
52
r = list (_ADS1015_CONFIG_DR .keys ())
52
53
r .sort ()
53
54
return r
54
55
55
56
@property
56
- def rate_config (self ) -> dict [int , int ]:
57
+ def rate_config (self ) -> Dict [int , int ]:
57
58
"""Rate configuration masks."""
58
59
return _ADS1015_CONFIG_DR
59
60
Original file line number Diff line number Diff line change 11
11
* Author(s): Carter Nelson
12
12
"""
13
13
import struct
14
+ from typing import Dict , List
14
15
15
16
# pylint: disable=unused-import
16
17
from .ads1x15 import ADS1x15 , Mode
@@ -47,14 +48,14 @@ def bits(self) -> int:
47
48
return 16
48
49
49
50
@property
50
- def rates (self ) -> list [int ]:
51
+ def rates (self ) -> List [int ]:
51
52
"""Possible data rate settings."""
52
53
r = list (_ADS1115_CONFIG_DR .keys ())
53
54
r .sort ()
54
55
return r
55
56
56
57
@property
57
- def rate_config (self ) -> dict [int , int ]:
58
+ def rate_config (self ) -> Dict [int , int ]:
58
59
"""Rate configuration masks."""
59
60
return _ADS1115_CONFIG_DR
60
61
Original file line number Diff line number Diff line change 20
20
from micropython import const
21
21
22
22
try :
23
- from typing import Optional
23
+ from typing import Optional , List , Dict
24
24
25
25
from busio import I2C
26
26
from microcontroller import Pin
@@ -103,12 +103,12 @@ def data_rate(self, rate: int) -> None:
103
103
self ._data_rate = rate
104
104
105
105
@property
106
- def rates (self ) -> list [int ]:
106
+ def rates (self ) -> List [int ]:
107
107
"""Possible data rate settings."""
108
108
raise NotImplementedError ("Subclass must implement rates property." )
109
109
110
110
@property
111
- def rate_config (self ) -> dict [int , int ]:
111
+ def rate_config (self ) -> Dict [int , int ]:
112
112
"""Rate configuration masks."""
113
113
raise NotImplementedError ("Subclass must implement rate_config property." )
114
114
@@ -125,7 +125,7 @@ def gain(self, gain: float) -> None:
125
125
self ._gain = gain
126
126
127
127
@property
128
- def gains (self ) -> list [float ]:
128
+ def gains (self ) -> List [float ]:
129
129
"""Possible gain settings."""
130
130
g = list (_ADS1X15_CONFIG_GAIN .keys ())
131
131
g .sort ()
You can’t perform that action at this time.
0 commit comments