30
30
from adafruit_bus_device .i2c_device import I2CDevice
31
31
32
32
try :
33
- from typing import Type
33
+ import typing # pylint: disable=unused-import
34
34
from busio import I2C
35
35
except ImportError :
36
36
pass
@@ -72,7 +72,7 @@ def __init__(
72
72
i2c_dev .write (b"\xFB \x00 " )
73
73
74
74
@property
75
- def values (self ) -> Type [ tuple ] :
75
+ def values (self ) -> _Values :
76
76
"""The current state of all values."""
77
77
self ._read_data ()
78
78
return self ._Values (
@@ -82,33 +82,33 @@ def values(self) -> Type[tuple]:
82
82
)
83
83
84
84
@property
85
- def joystick (self ) -> Type [ tuple ] :
85
+ def joystick (self ) -> _Joystick :
86
86
"""The current joystick position."""
87
87
return self ._joystick ()
88
88
89
89
@property
90
- def buttons (self ) -> Type [ tuple ] : # pylint: disable=invalid-name
90
+ def buttons (self ) -> _Buttons : # pylint: disable=invalid-name
91
91
"""The current pressed state of buttons C and Z."""
92
92
return self ._buttons ()
93
93
94
94
@property
95
- def acceleration (self ) -> Type [ tuple ] :
95
+ def acceleration (self ) -> _Acceleration :
96
96
"""The current accelerometer reading."""
97
97
return self ._acceleration ()
98
98
99
- def _joystick (self , do_read : bool = True ) -> Type [ tuple ] :
99
+ def _joystick (self , do_read : bool = True ) -> _Joystick :
100
100
if do_read :
101
101
self ._read_data ()
102
102
return self ._Joystick (self .buffer [0 ], self .buffer [1 ]) # x, y
103
103
104
- def _buttons (self , do_read : bool = True ) -> Type [ tuple ] :
104
+ def _buttons (self , do_read : bool = True ) -> _Buttons :
105
105
if do_read :
106
106
self ._read_data ()
107
107
return self ._Buttons (
108
108
not bool (self .buffer [5 ] & 0x02 ), not bool (self .buffer [5 ] & 0x01 ) # C # Z
109
109
)
110
110
111
- def _acceleration (self , do_read : bool = True ) -> Type [ tuple ] :
111
+ def _acceleration (self , do_read : bool = True ) -> _Acceleration :
112
112
if do_read :
113
113
self ._read_data ()
114
114
return self ._Acceleration (
0 commit comments