Skip to content

feat: add SensorLibrary entries for air-quality device classes - #138

Draft
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/air-quality-library-entries
Draft

feat: add SensorLibrary entries for air-quality device classes#138
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/air-quality-library-entries

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented May 24, 2026

Copy link
Copy Markdown

What

Add SensorLibrary convenience descriptions for the six air-quality device classes that were defined in SensorDeviceClass but had no library entry: CO, NITROGEN_DIOXIDE, NITROGEN_MONOXIDE, NITROUS_OXIDE, OZONE, SULPHUR_DIOXIDE.

Why

SensorLibrary already exposes FORMALDEHYDE and VOLATILE_ORGANIC_COMPOUNDS in the same concentration family, but the other standard Home Assistant air-quality pollutants were missing — so downstream BLE parsers had to hand-build a BaseSensorDescription instead of using the library. This fills that gap.

How

  • Each new constant mirrors the existing pattern and uses its canonical HA unit: CO → ppm (matching CO2), the rest → µg/m³ (matching FORMALDEHYDE/VOC).
  • No changes to SensorDeviceClass or Units — those values already existed; this is purely additive convenience.
  • Inserted alphabetically near their neighbours; no existing entries touched.

Testing

New tests/test_library.py parametrizes the six entries and asserts both their metadata and the SensorUpdate produced through update_predefined_sensor. Full suite green (20 passed); ruff check and ruff format --check clean.

🤖 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

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

codecov Bot commented May 24, 2026

Copy link
Copy Markdown

Codecov Report

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

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