Skip to content

Commit c1ac19f

Browse files
authored
Use type from circuitpython_typing for LED
1 parent 69d163f commit c1ac19f

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed

adafruit_espatcontrol/adafruit_espatcontrol_wifimanager.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,7 @@
1818

1919
try:
2020
from typing import Dict, Any, Optional, Union, Tuple
21-
22-
try:
23-
from typing import Protocol
24-
except ImportError:
25-
from typing_extensions import Protocol
26-
from adafruit_espatcontrol.adafruit_espatcontrol import ESP_ATcontrol
27-
28-
class Pixel(Protocol):
29-
"""
30-
A class for providing type hints for parameters
31-
requiring a pixel device (NeoPixel/DotStar)
32-
"""
33-
34-
def fill( # pylint: disable=unused-argument, no-self-use
35-
self, value: Union[int, Tuple[int, int, int]]
36-
) -> Any:
37-
"""
38-
Duck types out the fill method for pixel devices
39-
"""
40-
...
41-
21+
from circuitpython_typing.led import FillBasedLED
4222
except ImportError:
4323
pass
4424

@@ -52,7 +32,7 @@ def __init__(
5232
self,
5333
esp: ESP_ATcontrol,
5434
secrets: Dict[str, Union[str, int]],
55-
status_pixel: Optional[Pixel] = None,
35+
status_pixel: Optional[FillBasedLED] = None,
5636
attempts: int = 2,
5737
):
5838
"""

0 commit comments

Comments
 (0)