Skip to content

hts221: Migrate camelCase methods to snake_case.#136

Merged
nedseb merged 1 commit intomainfrom
fix/hts221-snake-case
Mar 15, 2026
Merged

hts221: Migrate camelCase methods to snake_case.#136
nedseb merged 1 commit intomainfrom
fix/hts221-snake-case

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 15, 2026

Closes #131

Summary

Rename all camelCase public methods to snake_case:

Before After
whoAmI() who_am_i()
poweroff() power_off()
poweron() power_on()
getODR() get_odr()
setODR(odr) set_odr(odr)
getAv() get_av()
setAv(av) set_av(av)

Also updates test scenarios (hts221.yaml, board_temperature_comparison.yaml) to use new names.

No backward-compatibility aliases (no release has been made yet).

Test plan

Mock tests

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

Hardware tests

python3 -m pytest tests/ --port /dev/ttyACM0 -k "hts221 and hardware" -s -v

@nedseb nedseb requested a review from Copilot March 15, 2026 06:50
@nedseb nedseb self-assigned this Mar 15, 2026
@nedseb nedseb added the enhancement New feature or request label Mar 15, 2026
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

This PR standardizes the HTS221 driver’s public API by renaming several methods from mixed/camelCase to snake_case, and updates the YAML-based scenario tests accordingly.

Changes:

  • Renamed HTS221 driver methods (e.g., whoAmIwho_am_i, poweron/poweroffpower_on/power_off, setODR/getODRset_odr/get_odr, setAv/getAvset_av/get_av).
  • Updated HTS221 scenario and board-level temperature comparison scenarios to call the new method names.

Reviewed changes

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

File Description
tests/scenarios/hts221.yaml Updates scenario calls/scripts to use the renamed HTS221 methods.
tests/scenarios/board_temperature_comparison.yaml Updates hardware scripts to use power_off() / power_on() on HTS221.
lib/hts221/hts221/device.py Renames HTS221 public methods to snake_case and updates internal usage in __init__.

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

Comment thread lib/hts221/hts221/device.py
@nedseb nedseb merged commit b61e328 into main Mar 15, 2026
7 checks passed
@nedseb nedseb deleted the fix/hts221-snake-case branch March 15, 2026 07:17
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hts221: Migrate camelCase methods to snake_case.

2 participants