apds9960: Migrate camelCase methods to snake_case.#139
Merged
Conversation
34bcb4a to
0148a3a
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the APDS9960 driver’s public API from camelCase to snake_case, updating the driver implementation as well as scenario tests and usage examples to match the new method names.
Changes:
- Renamed APDS9960 driver methods (public API + internal call sites) from camelCase to snake_case.
- Updated
tests/scenarios/apds9960.yamlto call the new snake_case API. - Updated APDS9960 example scripts (ambient light, proximity, gesture) to use snake_case.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/apds9960/apds9960/device.py | Renames driver methods and internal references to snake_case. |
| tests/scenarios/apds9960.yaml | Updates scenario calls/scripts to use new snake_case method names. |
| lib/apds9960/examples/ambient_light.py | Updates example usage to snake_case. |
| lib/apds9960/examples/proximity.py | Updates example usage to snake_case. |
| lib/apds9960/examples/gesture.py | Updates example usage to snake_case. |
Comments suppressed due to low confidence (1)
lib/apds9960/apds9960/device.py:918
get_light_int_high_threshold()docstring says it returns the "low threshold". Since this reads AIHT*, the docstring should describe the high-threshold value to avoid misleading API users.
def get_light_int_high_threshold(self):
"""Gets the high threshold for ambient light interrupts.
Returns:
int: threshold current low threshold stored on the APDS9960
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0148a3a to
63d6166
Compare
5 tasks
|
🎉 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 #134
Summary
Rename all 66 camelCase public methods to snake_case in the APDS9960 driver, including all internal call sites, tests, and examples.
No backward-compatibility aliases (no release yet).
Key renames
enablePower→enable_power,enableLightSensor→enable_light_sensorreadAmbientLight→read_ambient_light,readProximity→read_proximityisLightAvailable→is_light_available,isGestureAvailable→is_gesture_availablesetMode→set_mode,setLEDDrive→set_led_drive,setProximityGain→set_proximity_gainreadGesture→read_gesture,processGestureData→process_gesture_data,decodeGesture→decode_gestureFiles changed
lib/apds9960/apds9960/device.py— all method definitions + internal callstests/scenarios/apds9960.yaml— test method references + scriptslib/apds9960/examples/ambient_light.pylib/apds9960/examples/proximity.pylib/apds9960/examples/gesture.pyTest plan