hts221: Migrate camelCase methods to snake_case.#136
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.,
whoAmI→who_am_i,poweron/poweroff→power_on/power_off,setODR/getODR→set_odr/get_odr,setAv/getAv→set_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.
|
🎉 This PR is included in version 0.0.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #131
Summary
Rename all camelCase public methods to snake_case:
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
Hardware tests
python3 -m pytest tests/ --port /dev/ttyACM0 -k "hts221 and hardware" -s -v