Skip to content

Commit 5af7277

Browse files
fix doc formatting issues
1 parent 8971eff commit 5af7277

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

README.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ Please ensure all dependencies are available on the CircuitPython filesystem.
3535
This is easily achieved by downloading
3636
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
3737
or individual libraries can be installed using
38-
`circup <https://github.com/adafruit/circup>`_.Installing from PyPI
38+
`circup <https://github.com/adafruit/circup>`_.
39+
40+
Installing from PyPI
3941
=====================
40-
.. note:: This library is not available on PyPI yet. Install documentation is included
41-
as a standard element. Stay tuned for PyPI availability!
42+
.. note:: This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!
4243

4344
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
4445
PyPI <https://pypi.org/project/mindwidgets-circuitpython-df1201s/>`_.

mindwidgets_df1201s.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ def _map_volume(self, volume: float) -> int:
124124

125125
@property
126126
def connected(self) -> bool:
127-
"""True if the DFPlayer is connected."""
127+
"""
128+
:return: True if the DFPlayer is connected.
129+
"""
128130
return self._send_command("")
129131

130132
def set_baud_rate(self, rate: int) -> bool:
@@ -141,7 +143,9 @@ def set_baud_rate(self, rate: int) -> bool:
141143

142144
@property
143145
def volume(self) -> float:
144-
"""Volume level, as a float between 0 and 1."""
146+
"""
147+
:return: Volume level, as a float between 0 and 1.
148+
"""
145149
response = self._send_query("VOL", "?")
146150
df_volume = self._unwrap_int(response[7:-1])
147151
if df_volume < 0:
@@ -339,25 +343,35 @@ def total_files(self) -> int:
339343

340344
@property
341345
def file_number(self) -> int:
342-
"""The file number of the currently playing file."""
346+
"""
347+
:return: The file number of the currently playing file.
348+
"""
343349
return self._unwrap_int(self._send_query("QUERY", 1))
344350

345351
@property
346352
def file_name(self) -> str:
347-
"""The file name of the currently playing file."""
353+
"""
354+
:return: The file name of the currently playing file.
355+
"""
348356
return self._send_query("QUERY", 5)
349357

350358
@property
351359
def played_time(self) -> int:
352-
"""The number of seconds the current sound has played."""
360+
"""
361+
:return: The number of seconds the current sound has played.
362+
"""
353363
return self._unwrap_int(self._send_query("QUERY", 3))
354364

355365
@property
356366
def total_time(self) -> int:
357-
"""The length of the current sound in seconds."""
367+
"""
368+
:return: The length of the current sound in seconds.
369+
"""
358370
return self._unwrap_int(self._send_query("QUERY", 4))
359371

360372
@property
361373
def playing(self) -> bool:
362-
"""True if a sound is currently playing."""
374+
"""
375+
:return: True if a sound is currently playing.
376+
"""
363377
return self.played_time < self.total_time

0 commit comments

Comments
 (0)