Skip to content

Commit a0db3b5

Browse files
committedOct 29, 2024·
Adjust indentation in API docs
1 parent 1c53666 commit a0db3b5

File tree

4 files changed

+37
-37
lines changed

4 files changed

+37
-37
lines changed
 

‎src/modulino/buttons.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def set_led_status(self, a, b, c):
3030
Turn on or off the button LEDs according to the given status.
3131
3232
Parameters:
33-
a (bool): The status of the LED A.
33+
a (bool): The status of the LED A.
3434
b (bool): The status of the LED B.
3535
c (bool): The status of the LED C.
3636
"""
@@ -183,7 +183,7 @@ def is_pressed(self, index):
183183
Returns True if the button at the given index is currently pressed.
184184
185185
Parameters:
186-
index (int): The index of the button. A = 0, B = 1, C = 2.
186+
index (int): The index of the button. A = 0, B = 1, C = 2.
187187
"""
188188
return self._current_buttons_status[index]
189189

‎src/modulino/buzzer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def tone(self, frequency, lenght_ms=0xFFFF, blocking=False):
108108
If blocking is set to True, the function will wait until the tone is finished.
109109
110110
Parameters:
111-
frequency: The frequency of the tone in Hz
112-
lenght_ms: The duration of the tone in milliseconds
113-
blocking: If set to True, the function will wait until the tone is finished
111+
frequency: The frequency of the tone in Hz
112+
lenght_ms: The duration of the tone in milliseconds
113+
blocking: If set to True, the function will wait until the tone is finished
114114
"""
115115
self.data[0:4]=frequency.to_bytes(4,'little')
116116
self.data[4:8]=lenght_ms.to_bytes(4,'little')

‎src/modulino/knob.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def range(self, value):
126126
Sets the range of the encoder value.
127127
128128
Parameters:
129-
value (tuple): A tuple with two integers representing the minimum and maximum values of the range.
129+
value (tuple): A tuple with two integers representing the minimum and maximum values of the range.
130130
"""
131131
if(value[0] < -32768 or value[1] > 32767):
132132
raise ValueError("Range must be between -32768 and 32767")
@@ -152,7 +152,7 @@ def on_rotate_clockwise(self, value):
152152
Sets the callback for the rotate clockwise event.
153153
154154
Parameters:
155-
value (function): The function to be called when the encoder is rotated clockwise.
155+
value (function): The function to be called when the encoder is rotated clockwise.
156156
"""
157157
self._on_rotate_clockwise = value
158158

@@ -166,7 +166,7 @@ def on_rotate_counter_clockwise(self, value):
166166
Sets the callback for the rotate counter clockwise event.
167167
168168
Parameters:
169-
value (function): The function to be called when the encoder is rotated counter clockwise.
169+
value (function): The function to be called when the encoder is rotated counter clockwise.
170170
"""
171171
self._on_rotate_counter_clockwise = value
172172

@@ -180,7 +180,7 @@ def on_press(self, value):
180180
Sets the callback for the press event.
181181
182182
Parameters:
183-
value (function): The function to be called when the encoder is pressed.
183+
value (function): The function to be called when the encoder is pressed.
184184
"""
185185
self._on_press = value
186186

@@ -194,7 +194,7 @@ def on_release(self, value):
194194
Sets the callback for the release event.
195195
196196
Parameters:
197-
value (function): The function to be called when the encoder is released.
197+
value (function): The function to be called when the encoder is released.
198198
"""
199199
self._on_release = value
200200

@@ -211,7 +211,7 @@ def value(self, new_value):
211211
Sets the value of the encoder. This overrides the previous value.
212212
213213
Parameters:
214-
new_value (int): The new value of the encoder.
214+
new_value (int): The new value of the encoder.
215215
"""
216216
if(self._value_range != None):
217217
if(new_value < self._value_range[0]) or (new_value > self._value_range[1]):

‎src/modulino/pixels.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ def set_range_rgb(self, index_from, index_to, r, g, b, brightness=100):
3939
Sets the color of the LEDs in the given range to the given RGB values.
4040
4141
Parameters:
42-
index_from (int): The starting index of the range.
43-
index_to (int): The ending index (inclusive) of the range.
44-
r (int): The red value of the color.
45-
g (int): The green value of the color.
46-
b (int): The blue value of the color.
47-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
42+
index_from (int): The starting index of the range.
43+
index_to (int): The ending index (inclusive) of the range.
44+
r (int): The red value of the color.
45+
g (int): The green value of the color.
46+
b (int): The blue value of the color.
47+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
4848
"""
4949
self.set_range_color(index_from, index_to, ModulinoColor(r, g, b), brightness)
5050

@@ -53,10 +53,10 @@ def set_range_color(self, index_from, index_to, color, brightness=100):
5353
Sets the color of the LEDs in the given range to the given color.
5454
5555
Parameters:
56-
index_from (int): The starting index of the range.
57-
index_to (int): The ending index (inclusive) of the range.
58-
color (ModulinoColor): The color of the LEDs.
59-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
56+
index_from (int): The starting index of the range.
57+
index_to (int): The ending index (inclusive) of the range.
58+
color (ModulinoColor): The color of the LEDs.
59+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
6060
"""
6161
for i in range(index_from, index_to + 1):
6262
self.set_color(i, color, brightness)
@@ -66,10 +66,10 @@ def set_all_rgb(self, r, g, b, brightness=100):
6666
Sets the color of all the LEDs to the given RGB values.
6767
6868
Parameters:
69-
r (int): The red value of the color.
70-
g (int): The green value of the color.
71-
b (int): The blue value of the color.
72-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
69+
r (int): The red value of the color.
70+
g (int): The green value of the color.
71+
b (int): The blue value of the color.
72+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
7373
"""
7474
self.set_all_color(ModulinoColor(r, g, b), brightness)
7575

@@ -78,8 +78,8 @@ def set_all_color(self, color, brightness=100):
7878
Sets the color of all the LEDs to the given color.
7979
8080
Parameters:
81-
color (ModulinoColor): The color of the LEDs.
82-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
81+
color (ModulinoColor): The color of the LEDs.
82+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
8383
"""
8484
self.set_range_color(0, NUM_LEDS - 1, color, brightness)
8585

@@ -88,9 +88,9 @@ def set_color(self, idx, rgb : ModulinoColor , brightness=100):
8888
Sets the color of the given LED index to the given color.
8989
9090
Parameters:
91-
idx (int): The index of the LED.
92-
rgb (ModulinoColor): The color of the LED.
93-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
91+
idx (int): The index of the LED.
92+
rgb (ModulinoColor): The color of the LED.
93+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
9494
"""
9595
if idx < 0 or idx >= NUM_LEDS:
9696
raise ValueError(f"LED index out of range {idx} (Valid: 0..{NUM_LEDS - 1})")
@@ -105,11 +105,11 @@ def set_rgb(self, idx, r, g, b, brightness=100):
105105
Set the color of the given LED index to the given RGB values.
106106
107107
Parameters:
108-
idx (int): The index of the LED.
109-
r (int): The red value of the color.
110-
g (int): The green value of the color.
111-
b (int): The blue value of the color.
112-
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
108+
idx (int): The index of the LED.
109+
r (int): The red value of the color.
110+
g (int): The green value of the color.
111+
b (int): The blue value of the color.
112+
brightness (int): The brightness of the LED. It should be a value between 0 and 100.
113113
"""
114114
self.set_color(idx, ModulinoColor(r, g, b), brightness)
115115

@@ -118,7 +118,7 @@ def clear(self, idx):
118118
Turns off the LED at the given index.
119119
120120
Parameters:
121-
idx (int): The index of the LED.
121+
idx (int): The index of the LED.
122122
"""
123123
self.set_color(idx, ModulinoColor(0, 0, 0), 0)
124124

@@ -131,7 +131,7 @@ def clear_all(self):
131131
Turns all the LEDs off.
132132
133133
Parameters:
134-
idx (int): The index of the LED
134+
idx (int): The index of the LED
135135
"""
136136
self.data = bytearray([0xE0] * NUM_LEDS * 4)
137137

0 commit comments

Comments
 (0)
Please sign in to comment.