Skip to content

Commit 0ab431c

Browse files
authored
Merge pull request #26 from FoamyGuy/add_missing_docstrings
add missing docstrings
2 parents 201f238 + 43c144b commit 0ab431c

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

adafruit_fruitjam/peripherals.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ def any_button_pressed(self) -> bool:
256256

257257
@property
258258
def dac(self) -> adafruit_tlv320.TLV320DAC3100:
259+
"""
260+
The instance of the ``adafruit_tlv320.TLV320DAC3100`` driver class.
261+
Can be used for lower level DAC control.
262+
"""
259263
return self._dac
260264

261265
@dac.setter
@@ -269,6 +273,9 @@ def dac(self, value: adafruit_tlv320.TLV320DAC3100) -> None:
269273

270274
@property
271275
def audio(self) -> audiobusio.I2SOut:
276+
"""
277+
Instance of ``audiobusio.I2SOut`` ready to play audio through the TLV320 DAC.
278+
"""
272279
return self._audio
273280

274281
@audio.setter
@@ -280,12 +287,16 @@ def audio(self, value: audiobusio.I2SOut) -> None:
280287
self._audio = value
281288

282289
def sd_check(self) -> bool:
290+
"""
291+
Whether the SD card is mounted.
292+
:return: True if SD is mounted, False otherwise
293+
"""
283294
return self._sd_mounted
284295

285296
def play_file(self, file_name, wait_to_finish=True):
286297
"""Play a wav file.
287298
288-
:param str file_name: The name of the wav file to play on the speaker.
299+
:param str file_name: The name of the wav file to play.
289300
:param bool wait_to_finish: flag to determine if this is a blocking call
290301
291302
"""
@@ -300,7 +311,12 @@ def play_file(self, file_name, wait_to_finish=True):
300311
pass
301312
self.wavfile.close()
302313

303-
def play_mp3_file(self, filename):
314+
def play_mp3_file(self, filename: str):
315+
"""
316+
Play a mp3 audio file.
317+
318+
:param str filename: The name of the mp3 file to play.
319+
"""
304320
if self._audio is not None:
305321
if self._mp3_decoder is None:
306322
from audiomp3 import MP3Decoder # noqa: PLC0415, import outside top-level

0 commit comments

Comments
 (0)