Skip to content

docs: add API reference and usage guide, fix RTD Python version#317

Draft
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/docs-api-reference
Draft

docs: add API reference and usage guide, fix RTD Python version#317
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/docs-api-reference

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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.md was a TODO: Document usage stub and there was no API reference (issue #284). Separately, .readthedocs.yml pinned Python 3.9 while the package requires >=3.11 (pyproject.toml), so pip install . — and therefore the whole RTD build — would fail.

How:

  • .readthedocs.yml: ubuntu-22.04 + Python 3.12 (compatible with ^3.11).
  • conf.py: enable autodoc / 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 stray deezer-python PyPI link.

Testing: pip install .[docs] + sphinx-build -b html builds cleanly under Python 3.12 with every documented class/method rendered; isort/black/flake8/codespell pass.

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 statement
  • docs/source/usage.md:34 — debug print statement
  • docs/source/usage.md:38 — debug print statement

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan

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

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.00%. Comparing base (2a60814) to head (112b519).
⚠️ Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API reference

1 participant