docs: add API reference and usage guide, fix RTD Python version#317
Draft
bluetoothbot wants to merge 1 commit into
Draft
docs: add API reference and usage guide, fix RTD Python version#317bluetoothbot wants to merge 1 commit into
bluetoothbot wants to merge 1 commit into
Conversation
Closes Bluetooth-Devices#284. What: Replace the docs skeleton with a real usage guide and an autodoc-based API reference covering the fundamental public classes and methods. Why: docs/source/usage.md was a "TODO: Document usage" stub and there was no API reference at all. Separately, .readthedocs.yml pinned Python 3.9 while the package requires >=3.11 (pyproject), so `pip install .` — and thus the entire RTD build — would fail. How: - .readthedocs.yml: bump to ubuntu-22.04 + Python 3.12 (>=3.11 compatible). - conf.py: enable sphinx.ext.autodoc/autosummary/napoleon/viewcode/intersphinx; import the package for the version string. - api.md: autodoc the public surface (XiaomiBluetoothDeviceData, EncryptionScheme, the cloud bindkey-fetch classes/exceptions, SLEEPY_DEVICE_MODELS). - usage.md: real walkthrough — passive parsing, encrypted devices/bindkeys, cloud bindkey fetch, optional active polling. - installation.md: fix stray "deezer-python" PyPI link. Testing: `pip install .[docs]` + `sphinx-build -b html` builds cleanly under Python 3.12 with all classes/methods rendered; isort/black/flake8/codespell pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #317 +/- ##
=======================================
Coverage 54.00% 54.00%
=======================================
Files 7 7
Lines 1387 1387
Branches 271 271
=======================================
Hits 749 749
Misses 520 520
Partials 118 118 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What: Replace the docs skeleton with a real usage guide and an autodoc-based API reference, and fix the Read the Docs Python version.
Why:
docs/source/usage.mdwas aTODO: Document usagestub and there was no API reference (issue #284). Separately,.readthedocs.ymlpinned Python 3.9 while the package requires >=3.11 (pyproject.toml), sopip install .— and therefore the whole RTD build — would fail.How:
.readthedocs.yml: ubuntu-22.04 + Python 3.12 (compatible with^3.11).conf.py: enableautodoc/autosummary/napoleon/viewcode/intersphinx; pull the version from the package.api.md(new): autodoc the public surface —XiaomiBluetoothDeviceData,EncryptionScheme, the cloud bindkey-fetch classes/exceptions,SLEEPY_DEVICE_MODELS. Generated from code, so it won't drift.usage.md: real walkthrough — passive parsing, encrypted devices/bindkeys, cloud bindkey fetch, optional active polling.installation.md: fix a straydeezer-pythonPyPI link.Testing:
pip install .[docs]+sphinx-build -b htmlbuilds cleanly under Python 3.12 with every documented class/method rendered;isort/black/flake8/codespellpass.Closes #284.
Quality Report
Changes: 6 files changed, 223 insertions(+), 10 deletions(-)
Code scan: 3 issue(s) found
docs/source/usage.md:30— debug print statementdocs/source/usage.md:34— debug print statementdocs/source/usage.md:38— debug print statementTests: failed (FAILED)
Branch hygiene: clean
Generated by Kōan