feat: export base description classes from package root - #146
Draft
bluetoothbot wants to merge 1 commit into
Draft
feat: export base description classes from package root#146bluetoothbot wants to merge 1 commit into
bluetoothbot wants to merge 1 commit into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 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: Export the base description classes (
BaseDescription,BaseSensorDescription,BaseBinarySensorDescription) from the package root.Why:
SensorLibraryexposesBaseSensorDescriptioninstances as its public API (e.g.SensorLibrary.BATTERY__PERCENTAGE), but the class itself was not importable fromsensor_state_data. Consumers iterating the library could not annotate orisinstance-check those values against any exported type — they are also not instances of the already-exportedSensorDescription.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.pypins the contract — base classes importable from root,SensorLibraryentries areBaseSensorDescriptioninstances, 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