Skip to content

refactor(hts221): Verify equivalence with WSEN-HIDS and drop HTS221 driver #426

@nedseb

Description

@nedseb

Context

The STeaMi board ships a Würth WSEN-HIDS (P/N 2525020210001), not an ST HTS221. The wiki confirms this — docs/hardware/main-components/sensors/wsen-hids.md declares WSEN-HIDS as the installed humidity + temperature sensor.

Both drivers currently live in this repo:

  • lib/hts221/ (238 lines in device.py) — minimal, legacy
  • lib/wsen-hids/ (404 lines in device.py) — current, with averaging support, custom exceptions, two-point calibration

Register-level comparison (lib/hts221/hts221/const.py vs lib/wsen-hids/wsen_hids/const.py):

Field hts221 wsen-hids
I2C address 0x5F 0x5F
Device ID 0xBC (WHO_AM_I) 0xBC
Register map identical identical (more exposed)
ODR encodings identical identical
Calibration factory only factory + 2-point user
Averaging not exposed AVG_2AVG_256 constants

WSEN-HIDS is a second-source of HTS221 — same silicon family, fully drop-in. Keeping both modules is dead weight against real STeaMi hardware and confuses users.

Scope

Phase 1 — Confirm equivalence

  • Diff hts221/const.py and wsen_hids/const.py register-by-register.
  • Diff hts221/device.py and wsen_hids/device.py method-by-method.
  • Cross-check on real hardware that wsen_hids returns plausible values on the STeaMi internal I2C bus.
  • List any HTS221-only feature that is not present in WSEN-HIDS — port it over before removal. (Expected: none. WSEN-HIDS is a strict superset.)

Phase 2 — Remove lib/hts221

  • Delete lib/hts221/ (driver, examples, README, manifest, tests).
  • Remove HTS221 entries from the README driver table and any aggregated docs.
  • Audit tests/ scenarios for hts221 references — retarget temperature/humidity comparison scenarios onto wsen_hids where applicable.
  • Sweep manifest.py / package metadata for hts221 entries.

Out of scope

  • Custom boards mounting a real ST HTS221 — the WSEN-HIDS driver works on them too (identical silicon-level behavior).

Cross-repo

Mirror issues are being filed on arduino-steami-lib (same duplication) and wiki_steami (residual HTS221 mention in docs/design/sensors.md).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions