Skip to content

feat: add weather/environmental sensor device classes - #147

Draft
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/weather-sensor-device-classes
Draft

feat: add weather/environmental sensor device classes#147
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/weather-sensor-device-classes

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jun 22, 2026

Copy link
Copy Markdown

What: Add five Home Assistant SensorDeviceClass members that this mirror was missing: ATMOSPHERIC_PRESSURE, IRRADIANCE, PRECIPITATION, PRECIPITATION_INTENSITY, WIND_SPEED.

Why: The library intentionally mirrors HA's device classes (the main feature work here, e.g. PM4 and the air-quality classes). These five are standard upstream device classes that map directly to common BLE weather-station / environmental readings, yet had no representation here — so a parser had no canonical device class to attach to those readings.

How: Additive enum members only, placed in roughly alphabetical position. ATMOSPHERIC_PRESSURE is kept distinct from the existing PRESSURE to match HA (same units, different semantics). No units.py or library.py changes — device classes stand on their own, matching the many existing members without a convenience SensorLibrary entry.

Testing: New tests/test_sensor_device_class_weather.py pins each string value (the HA interop contract) and asserts ATMOSPHERIC_PRESSURE != PRESSURE. Full suite green (11 passed), ruff clean.


Quality Report

Changes: 2 files changed, 39 insertions(+)

Code scan: clean

Tests: passed (11 passed)

Branch hygiene: clean

Generated by Kōan

Add five Home Assistant SensorDeviceClass members that are missing from this
mirror: ATMOSPHERIC_PRESSURE, IRRADIANCE, PRECIPITATION,
PRECIPITATION_INTENSITY, and WIND_SPEED. These map to common BLE
weather-station readings and were absent here while present upstream.

Additive only; string values pinned with tests as the HA interop contract.
@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.43%. Comparing base (31bd826) to head (e9f76dd).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #147      +/-   ##
==========================================
+ Coverage   94.37%   94.43%   +0.05%     
==========================================
  Files          12       12              
  Lines         480      485       +5     
  Branches        5        5              
==========================================
+ Hits          453      458       +5     
  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