feat: add SensorLibrary entries for air-quality device classes - #138
Draft
bluetoothbot wants to merge 1 commit into
Draft
feat: add SensorLibrary entries for air-quality device classes#138bluetoothbot wants to merge 1 commit into
bluetoothbot wants to merge 1 commit into
Conversation
CO, NITROGEN_DIOXIDE, NITROGEN_MONOXIDE, NITROUS_OXIDE, OZONE and SULPHUR_DIOXIDE already existed in SensorDeviceClass but had no SensorLibrary convenience description, unlike FORMALDEHYDE and VOLATILE_ORGANIC_COMPOUNDS in the same concentration family. Add them with their canonical Home Assistant units (CO in ppm, the rest in µg/m³) plus behavioral coverage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #138 +/- ##
==========================================
+ Coverage 94.37% 94.44% +0.06%
==========================================
Files 12 12
Lines 480 486 +6
Branches 5 5
==========================================
+ Hits 453 459 +6
Misses 26 26
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 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
Add
SensorLibraryconvenience descriptions for the six air-quality device classes that were defined inSensorDeviceClassbut had no library entry:CO,NITROGEN_DIOXIDE,NITROGEN_MONOXIDE,NITROUS_OXIDE,OZONE,SULPHUR_DIOXIDE.Why
SensorLibraryalready exposesFORMALDEHYDEandVOLATILE_ORGANIC_COMPOUNDSin the same concentration family, but the other standard Home Assistant air-quality pollutants were missing — so downstream BLE parsers had to hand-build aBaseSensorDescriptioninstead of using the library. This fills that gap.How
CO→ ppm (matchingCO2), the rest → µg/m³ (matchingFORMALDEHYDE/VOC).SensorDeviceClassorUnits— those values already existed; this is purely additive convenience.Testing
New
tests/test_library.pyparametrizes the six entries and asserts both their metadata and theSensorUpdateproduced throughupdate_predefined_sensor. Full suite green (20 passed);ruff checkandruff format --checkclean.🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 123 insertions(+)
Code scan: clean
Tests: passed (20 passed)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline