Skip to content

Add I2C sensor settings for backported v2 drivers#337

Open
tyeth wants to merge 4 commits into
v2from
add/settings-backported-i2c
Open

Add I2C sensor settings for backported v2 drivers#337
tyeth wants to merge 4 commits into
v2from
add/settings-backported-i2c

Conversation

@tyeth

@tyeth tyeth commented Jun 22, 2026

Copy link
Copy Markdown
Member

Overview

Adds settings blocks to the I2C components whose firmware drivers were backported with configurable options in Adafruit_Wippersnapper_Arduino#933 — the components-side counterpart, in the same spirit as #327. Setting option order and default index match the firmware set* mapping / configureDefaults().

Schema change

Extends components/i2c/schema.json $defs/setting to a oneOf supporting two kinds of setting:

  • option-based (unchanged) — firmware receives the selected option's 0-based index.
  • numeric (new) — type of "int" or "float" with optional min/max/default/step/unit; firmware receives the entered value directly via ws.config.Value (int/float), not an index.

Option settings added

ina260, ina237/238/228, lps28dfw, spa06_003, htu31d, hdc302x, as7331, as5600, mlx90632b/d_med/d_ext, vcnl4200/4030 — gains, integration/conversion times, modes, oversampling, rates, resolutions, etc.

Numeric settings added (new type)

  • sea_level_pressure (hPa) on the BMP/BME altitude components: bme280, bme680, bme688, bmp280, bmp388, bmp390, bmp580, bmp581, bmp585.
  • shunt_resistance (Ω) and max_current (A) on ina237, ina238, ina228.
  • z_position, m_position, max_angle (raw 12-bit) on as5600.

All 94 i2c definitions validate against the updated schema.

🤖 Generated with Claude Code

tyeth and others added 2 commits June 22, 2026 13:59
Adds index-based `settings` blocks (per the v2 settings schema, ref #327) to
the I2C components whose firmware drivers were backported with configurable
options in Adafruit_Wippersnapper_Arduino. Each setting's option order and
default index matches the firmware driver's set* mapping / configureDefaults().

Components updated: ina260, ina237, ina238, ina228, lps28dfw, spa06_003,
htu31d, hdc302x, as7331, as5600, mlx90632b, mlx90632d_med, mlx90632d_ext,
vcnl4200, vcnl4030.

Notes:
- The settings model is index-into-options only, so continuous/physical
  calibration values (INA shunt resistance & max current; AS5600 zero/max
  angle positions) are intentionally not surfaced here.
- SPA06-003 exposes the 1-128 Hz output-data-rate subset.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extends the i2c settings schema to support numeric (direct-value) settings
alongside the existing option-index settings, via a `oneOf`. A numeric setting
declares `type` ("int" or "float") with optional min/max/default/step/unit, and
firmware receives the entered value directly (ws.config.Value int/float) rather
than an option index.

Uses it for the continuous/physical values that don't fit an option list:
- sea_level_pressure (hPa) on the BMP/BME altitude components (bme280, bme680,
  bme688, bmp280, bmp388, bmp390, bmp580, bmp581, bmp585).
- shunt_resistance (Ω) and max_current (A) on ina237, ina238, ina228.
- z_position, m_position, max_angle (raw 12-bit) on as5600.

Firmware counterpart: adafruit/Adafruit_Wippersnapper_Arduino#933.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tyeth and others added 2 commits June 22, 2026 18:09
The HDC302x driver disables auto-mode and does a single-shot read per the
user's chosen polling period (like most sensors), so the per-read trigger
mode is not user-configurable. Keep only the heater setting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The "List All Changed Files" step always diffed against origin/main, so PRs
targeting v2 swept every v2-vs-main difference (.gitignore, etc.) into the
filename validation and flagged them spuriously. Diff against v2 when the PR
targets v2; otherwise diff against main (unchanged for main and
workflow_dispatch).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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