40
40
"""
41
41
42
42
try :
43
- from typing import Tuple
43
+ from typing import Union , Tuple
44
44
except ImportError :
45
45
pass
46
46
@@ -70,7 +70,7 @@ class _ClueSimpleTextDisplay:
70
70
def __init__ ( # pylint: disable=too-many-arguments
71
71
self ,
72
72
title : str = None ,
73
- title_color : int = 0xFFFFFF ,
73
+ title_color : Union [ int , Tuple ] = 0xFFFFFF ,
74
74
title_scale : int = 1 ,
75
75
text_scale : int = 1 ,
76
76
font : str = None ,
@@ -387,7 +387,7 @@ def shake(
387
387
return total_accel > shake_threshold
388
388
389
389
@property
390
- def acceleration (self ) -> Tuple [ float , float , float ] :
390
+ def acceleration (self ) -> Tuple :
391
391
"""Obtain acceleration data from the x, y and z axes.
392
392
393
393
.. image :: ../docs/_static/accelerometer.jpg
@@ -407,7 +407,7 @@ def acceleration(self) -> Tuple[float, float, float]:
407
407
return self ._accelerometer .acceleration
408
408
409
409
@property
410
- def gyro (self ) -> Tuple [ float , float , float ] :
410
+ def gyro (self ) -> Tuple :
411
411
"""Obtain x, y, z angular velocity values in degrees/second.
412
412
413
413
.. image :: ../docs/_static/accelerometer.jpg
@@ -427,7 +427,7 @@ def gyro(self) -> Tuple[float, float, float]:
427
427
return self ._accelerometer .gyro
428
428
429
429
@property
430
- def magnetic (self ) -> Tuple [ float , float , float ] :
430
+ def magnetic (self ) -> Tuple :
431
431
"""Obtain x, y, z magnetic values in microteslas.
432
432
433
433
.. image :: ../docs/_static/magnetometer.jpg
@@ -469,7 +469,7 @@ def proximity(self) -> int:
469
469
return self ._sensor .proximity
470
470
471
471
@property
472
- def color (self ) -> Tuple [ int , int , int , int ] :
472
+ def color (self ) -> Tuple :
473
473
"""The red, green, blue, and clear light values. (r, g, b, c)
474
474
475
475
.. image :: ../docs/_static/proximity.jpg
@@ -869,7 +869,7 @@ def loud_sound(self, sound_threshold: int = 200) -> bool:
869
869
@staticmethod
870
870
def simple_text_display ( # pylint: disable=too-many-arguments
871
871
title : str = None ,
872
- title_color : Tuple [ int , int , int ] = (255 , 255 , 255 ),
872
+ title_color : Tuple = (255 , 255 , 255 ),
873
873
title_scale : int = 1 ,
874
874
text_scale : int = 1 ,
875
875
font : str = None ,
0 commit comments