@@ -31,8 +31,8 @@ def set_led_status(self, a, b, c):
31
31
32
32
Parameters:
33
33
a (bool): The status of the LED A.
34
- b (bool): The status of the LED B.
35
- c (bool): The status of the LED C.
34
+ b (bool): The status of the LED B.
35
+ c (bool): The status of the LED C.
36
36
"""
37
37
data = bytearray (3 )
38
38
data [0 ] = 1 if a else 0
@@ -42,82 +42,144 @@ def set_led_status(self, a, b, c):
42
42
43
43
@property
44
44
def long_press_duration (self ):
45
+ """
46
+ Returns the duration in milliseconds that the button must
47
+ be pressed to trigger the long press event
48
+ """
45
49
return self ._long_press_duration
46
50
47
51
@long_press_duration .setter
48
52
def long_press_duration (self , value ):
53
+ """
54
+ Sets the duration in milliseconds that the button must
55
+ be pressed to trigger the long press event
56
+ """
49
57
self ._long_press_duration = value
50
58
51
59
@property
52
60
def on_button_a_press (self ):
61
+ """
62
+ Returns the callback for the press event of button A.
63
+ """
53
64
return self ._on_button_a_press
54
65
55
66
@on_button_a_press .setter
56
67
def on_button_a_press (self , value ):
68
+ """
69
+ Sets the callback for the press event of button A.
70
+ """
57
71
self ._on_button_a_press = value
58
72
59
73
@property
60
74
def on_button_a_release (self ):
75
+ """
76
+ Returns the callback for the release event of button A.
77
+ """
61
78
return self ._on_button_a_release
62
79
63
80
@on_button_a_release .setter
64
81
def on_button_a_release (self , value ):
82
+ """
83
+ Sets the callback for the release event of button A.
84
+ """
65
85
self ._on_button_a_release = value
66
86
67
87
@property
68
88
def on_button_a_long_press (self ):
89
+ """
90
+ Returns the callback for the long press event of button A.
91
+ """
69
92
return self ._on_button_a_long_press
70
93
71
94
@on_button_a_long_press .setter
72
95
def on_button_a_long_press (self , value ):
96
+ """
97
+ Sets the callback for the long press event of button A.
98
+ """
73
99
self ._on_button_a_long_press = value
74
100
75
101
@property
76
102
def on_button_b_press (self ):
103
+ """
104
+ Returns the callback for the press event of button B.
105
+ """
77
106
return self ._on_button_b_press
78
107
79
108
@on_button_b_press .setter
80
109
def on_button_b_press (self , value ):
110
+ """
111
+ Sets the callback for the press event of button B.
112
+ """
81
113
self ._on_button_b_press = value
82
114
83
115
@property
84
116
def on_button_b_release (self ):
117
+ """
118
+ Returns the callback for the release event of button B.
119
+ """
85
120
return self ._on_button_b_release
86
121
87
122
@on_button_b_release .setter
88
123
def on_button_b_release (self , value ):
124
+ """
125
+ Sets the callback for the release event of button B.
126
+ """
89
127
self ._on_button_b_release = value
90
128
91
129
@property
92
130
def on_button_b_long_press (self ):
131
+ """
132
+ Returns the callback for the long press event of button B.
133
+ """
93
134
return self ._on_button_b_long_press
94
135
95
136
@on_button_b_long_press .setter
96
137
def on_button_b_long_press (self , value ):
138
+ """
139
+ Sets the callback for the long press event of button B.
140
+ """
97
141
self ._on_button_b_long_press = value
98
142
99
143
@property
100
144
def on_button_c_press (self ):
145
+ """
146
+ Returns the callback for the press event of button C.
147
+ """
101
148
return self ._on_button_c_press
102
149
103
150
@on_button_c_press .setter
104
151
def on_button_c_press (self , value ):
152
+ """
153
+ Sets the callback for the press event of button C.
154
+ """
105
155
self ._on_button_c_press = value
106
156
107
157
@property
108
158
def on_button_c_release (self ):
159
+ """
160
+ Returns the callback for the release event of button C.
161
+ """
109
162
return self ._on_button_c_release
110
163
111
164
@on_button_c_release .setter
112
165
def on_button_c_release (self , value ):
166
+ """
167
+ Sets the callback for the release event of button C.
168
+ """
113
169
self ._on_button_c_release = value
114
170
115
171
@property
116
172
def on_button_c_long_press (self ):
173
+ """
174
+ Returns the callback for the long press event of button C.
175
+ """
117
176
return self ._on_button_c_long_press
118
177
119
178
@on_button_c_long_press .setter
120
179
def on_button_c_long_press (self , value ):
180
+ """
181
+ Sets the callback for the long press event of button C.
182
+ """
121
183
self ._on_button_c_long_press = value
122
184
123
185
def update (self ):
@@ -189,12 +251,21 @@ def is_pressed(self, index):
189
251
190
252
@property
191
253
def button_a_pressed (self ):
254
+ """
255
+ Returns True if button A is currently pressed.
256
+ """
192
257
return self .is_pressed (0 )
193
258
194
259
@property
195
260
def button_b_pressed (self ):
261
+ """
262
+ Returns True if button B is currently pressed.
263
+ """
196
264
return self .is_pressed (1 )
197
265
198
266
@property
199
267
def button_c_pressed (self ):
268
+ """
269
+ Returns True if button C is currently pressed.
270
+ """
200
271
return self .is_pressed (2 )
0 commit comments