Skip to content

fix: normalize micro codepoint to U+00B5 in Units - #145

Draft
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/fix-micro-codepoint
Draft

fix: normalize micro codepoint to U+00B5 in Units#145
bluetoothbot wants to merge 1 commit into
Bluetooth-Devices:mainfrom
bluetoothbot:koan/fix-micro-codepoint

Conversation

@bluetoothbot

@bluetoothbot bluetoothbot commented Jun 22, 2026

Copy link
Copy Markdown

What: Normalize the two "micro" units that used the Greek letter mu (U+03BC) to the micro sign (U+00B5).

Why: TIME_MICROSECONDS (µs) and CONCENTRATION_MICROGRAMS_PER_CUBIC_FOOT (µg/ft³) were declared with U+03BC, while every other micro unit in the enum — and the Home Assistant constants this library mirrors — use U+00B5. The glyphs render identically but compare unequal, so string equality against HA's unit constants silently failed for exactly these two members. Closes #143.

How: Two-character value change in units.py; member names and all other values are untouched. Added tests/test_units.py pinning every micro unit to U+00B5 so the inconsistency can't recur.

Testing: New regression tests fail on main and pass on this branch; full suite (10 tests) green under Python 3.12, ruff clean.


Quality Report

Changes: 2 files changed, 27 insertions(+), 2 deletions(-)

Code scan: clean

Tests: passed (10 passed)

Branch hygiene: clean

Generated by Kōan

TIME_MICROSECONDS and CONCENTRATION_MICROGRAMS_PER_CUBIC_FOOT used the
Greek small letter mu (U+03BC) while every other micro unit — and Home
Assistant — uses the micro sign (U+00B5). The two glyphs render
identically but compare unequal, so string equality against HA's unit
constants silently failed for these two members.

Closes Bluetooth-Devices#143.
@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 (a5c3097).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #145   +/-   ##
=======================================
  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.

Units: inconsistent micro codepoint (U+03BC vs U+00B5) breaks string equality

1 participant