Skip to content

Commit e222fe3

Browse files
committed
Fix tuple typing
1 parent 27028b3 commit e222fe3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

adafruit_clue.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"""
4141

4242
try:
43-
from typing import Tuple
43+
from typing import Union, Tuple
4444
except ImportError:
4545
pass
4646

@@ -70,7 +70,7 @@ class _ClueSimpleTextDisplay:
7070
def __init__( # pylint: disable=too-many-arguments
7171
self,
7272
title: str = None,
73-
title_color: int = 0xFFFFFF,
73+
title_color: Union[int, Tuple] = 0xFFFFFF,
7474
title_scale: int = 1,
7575
text_scale: int = 1,
7676
font: str = None,
@@ -387,7 +387,7 @@ def shake(
387387
return total_accel > shake_threshold
388388

389389
@property
390-
def acceleration(self) -> Tuple[float, float, float]:
390+
def acceleration(self) -> Tuple:
391391
"""Obtain acceleration data from the x, y and z axes.
392392
393393
.. image :: ../docs/_static/accelerometer.jpg
@@ -407,7 +407,7 @@ def acceleration(self) -> Tuple[float, float, float]:
407407
return self._accelerometer.acceleration
408408

409409
@property
410-
def gyro(self) -> Tuple[float, float, float]:
410+
def gyro(self) -> Tuple:
411411
"""Obtain x, y, z angular velocity values in degrees/second.
412412
413413
.. image :: ../docs/_static/accelerometer.jpg
@@ -427,7 +427,7 @@ def gyro(self) -> Tuple[float, float, float]:
427427
return self._accelerometer.gyro
428428

429429
@property
430-
def magnetic(self) -> Tuple[float, float, float]:
430+
def magnetic(self) -> Tuple:
431431
"""Obtain x, y, z magnetic values in microteslas.
432432
433433
.. image :: ../docs/_static/magnetometer.jpg
@@ -469,7 +469,7 @@ def proximity(self) -> int:
469469
return self._sensor.proximity
470470

471471
@property
472-
def color(self) -> Tuple[int, int, int, int]:
472+
def color(self) -> Tuple:
473473
"""The red, green, blue, and clear light values. (r, g, b, c)
474474
475475
.. image :: ../docs/_static/proximity.jpg
@@ -869,7 +869,7 @@ def loud_sound(self, sound_threshold: int = 200) -> bool:
869869
@staticmethod
870870
def simple_text_display( # pylint: disable=too-many-arguments
871871
title: str = None,
872-
title_color: Tuple[int, int, int] = (255, 255, 255),
872+
title_color: Tuple = (255, 255, 255),
873873
title_scale: int = 1,
874874
text_scale: int = 1,
875875
font: str = None,

0 commit comments

Comments
 (0)