Skip to content

v0.9.2 — per-cell IR exposed as attribute

Latest

Choose a tag to compare

@mtheli mtheli released this 17 May 19:43

What's new

The 16 cell-voltage sensors per channel now carry an ir_mohm attribute mirroring the matching entry in the device's per-cell internal-resistance array. Sentinel / zero values return None so consumers can suppress display rather than plot a fake reading.

This unblocks an upcoming Lovelace card layout for the LiPo balance chargers (Air 8, K2 Air) that needs to show both voltage and IR per cell. Without an attribute, the card had no way to reach the IR data for cells beyond the primary one — the integration only exposed a single internal_resistance sensor per channel.

Behaviour

  • Each enabled cell_<N> sensor surfaces attributes.ir_mohm when the underlying raw reading is a sane value (single-to-tens of mΩ band).
  • 0xFFFF (sentinel for "cell not present") and 0 (cell present but IR not measured yet) both yield None.
  • The standalone internal_resistance sensor is unchanged.

No user-visible change unless you start consuming the new attribute. Cell sensors stay disabled by default as before.

Tests

36/36 pytest cases green, including a new fixture-driven check that the wire layout for the 19-byte short IRResp carries 8 slots with sentinel 0xFFFF for unpopulated cells.