Skip to content

feat: export base description classes from package root - #146

Draft
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/export-base-descriptions
Draft

feat: export base description classes from package root#146
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/export-base-descriptions

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jun 22, 2026

Copy link
Copy Markdown

What: Export the base description classes (BaseDescription, BaseSensorDescription, BaseBinarySensorDescription) from the package root.

Why: SensorLibrary exposes BaseSensorDescription instances as its public API (e.g. SensorLibrary.BATTERY__PERCENTAGE), but the class itself was not importable from sensor_state_data. Consumers iterating the library could not annotate or isinstance-check those values against any exported type — they are also not instances of the already-exported SensorDescription.

How: Add the three base classes to the __init__ imports and __all__. Purely additive; no behavior change, nothing removed or renamed.

Testing: New tests/test_public_api.py pins the contract — base classes importable from root, SensorLibrary entries are BaseSensorDescription instances, and every __all__ name resolves. Full suite passes (11 in the touched set), ruff clean.


Quality Report

Changes: 2 files changed, 38 insertions(+), 1 deletion(-)

Code scan: clean

Tests: passed (11 passed)

Branch hygiene: clean

Generated by Kōan

SensorLibrary exposes BaseSensorDescription instances as its public API,
but the base description classes were not importable from the package
root. Consumers iterating SensorLibrary could not annotate or
isinstance-check the values against any exported type.

Export BaseDescription, BaseSensorDescription, and
BaseBinarySensorDescription. Additive, non-breaking.
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.37%. Comparing base (31bd826) to head (a45214b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #146   +/-   ##
=======================================
  Coverage   94.37%   94.37%           
=======================================
  Files          12       12           
  Lines         480      480           
  Branches        5        5           
=======================================
  Hits          453      453           
  Misses         26       26           
  Partials        1        1           

☔ 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.

1 participant