Skip to content

apds9960: Migrate camelCase methods to snake_case.#139

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

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

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Mar 15, 2026

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

Category Examples
Enable/disable enablePowerenable_power, enableLightSensorenable_light_sensor
Read readAmbientLightread_ambient_light, readProximityread_proximity
Status isLightAvailableis_light_available, isGestureAvailableis_gesture_available
Config setModeset_mode, setLEDDriveset_led_drive, setProximityGainset_proximity_gain
Gesture readGestureread_gesture, processGestureDataprocess_gesture_data, decodeGesturedecode_gesture

Files changed

  • lib/apds9960/apds9960/device.py — all method definitions + internal calls
  • tests/scenarios/apds9960.yaml — test method references + scripts
  • lib/apds9960/examples/ambient_light.py
  • lib/apds9960/examples/proximity.py
  • lib/apds9960/examples/gesture.py

Test plan

python3 -m pytest tests/ -k "apds9960 and mock" -v  # 8 passed

@nedseb nedseb force-pushed the fix/apds9960-snake-case branch from 34bcb4a to 0148a3a Compare March 15, 2026 07:06
@nedseb nedseb requested a review from Copilot March 15, 2026 07:06
@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 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.yaml to 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.

Comment thread lib/apds9960/apds9960/device.py Outdated
Comment thread lib/apds9960/apds9960/device.py Outdated
Comment thread lib/apds9960/apds9960/device.py Outdated
Comment thread lib/apds9960/apds9960/device.py Outdated
Comment thread lib/apds9960/apds9960/device.py Outdated
@nedseb nedseb force-pushed the fix/apds9960-snake-case branch from 0148a3a to 63d6166 Compare March 15, 2026 07:13
@nedseb nedseb merged commit 4dfd8c3 into main Mar 15, 2026
3 checks passed
@nedseb nedseb deleted the fix/apds9960-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.

apds9960: Migrate camelCase methods to snake_case.

2 participants