Skip to content

hts221: Add reboot() method for memory reload.#146

Merged
nedseb merged 2 commits intofix/standardize-resetfrom
fix/hts221-reboot
Mar 15, 2026
Merged

hts221: Add reboot() method for memory reload.#146
nedseb merged 2 commits intofix/standardize-resetfrom
fix/hts221-reboot

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 15, 2026

Closes #144
Sub-PR of #143

Summary

Add reboot() method to the HTS221 driver. Sets the BOOT bit in CTRL_REG2 to reload calibration data from non-volatile memory, waits 15ms, then re-reads temperature and humidity calibration registers.

Follows the same pattern as WSEN-HIDS and LIS2MDL reboot().

Test plan

python3 -m pytest tests/ -k "hts221 and mock" -v  # 14 passed

2 new mock tests:

  • Reboot reloads calibration
  • Reboot writes BOOT bit

@nedseb nedseb requested a review from Copilot March 15, 2026 09:54
@nedseb nedseb self-assigned this Mar 15, 2026
@nedseb nedseb added the enhancement New feature or request label Mar 15, 2026
@nedseb nedseb linked an issue Mar 15, 2026 that may be closed by this pull request
3 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a reboot() API to the HTS221 driver and extends the HTS221 YAML scenario suite to validate the reboot behavior in mock mode.

Changes:

  • Implement HTS221.reboot() by setting the CTRL_REG2 BOOT bit and re-reading temperature/humidity calibration.
  • Add mock-mode scenario tests covering reboot invocation and BOOT-bit write logging.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/hts221/hts221/device.py Adds a reboot() method that triggers BOOT and reloads calibration values.
tests/scenarios/hts221.yaml Adds mock scenario coverage for reboot() and verifying a BOOT-bit register write.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/scenarios/hts221.yaml Outdated
@nedseb nedseb merged commit 15ef34f into fix/standardize-reset Mar 15, 2026
@nedseb nedseb deleted the fix/hts221-reboot branch March 15, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hts221: Add reboot() method for memory reload.

2 participants