Skip to content

Added getter and setter functions for ROI #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 2, 2024

Conversation

TheIllusionist77
Copy link
Contributor

I was not able to find getter and setter functions for changing the ROI of the sensor, so I attempted to create my own.

This is my first time creating a pull request, so I apologize in advance if I messed something up.

@FoamyGuy
Copy link
Contributor

@TheIllusionist77 Thanks for working on this.

The easiest way to get the issues with the actions worked out is to install and run pre-commit and then commit / push the resulting changes, it'll fix up the code format and things for you. This page details the process: https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/check-your-code

For simple getters and setters we prefer to have properties instead of just getter / setter functions. https://docs.circuitpython.org/en/latest/docs/design_guide.html#getters-setters It's easy to convert functions to properties with decorators see an example in the timing_budget properties within this library: https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X/blob/main/adafruit_vl53l1x.py#L235-L244

@TheIllusionist77
Copy link
Contributor Author

Definitely many more commits than needed - it's my first time using pre-commit and actually the Git command line in general.

Anyway, is this good for the ROI getters and setters?

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thank you!

@FoamyGuy FoamyGuy merged commit a5ebcca into adafruit:main Nov 2, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Nov 3, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_Fingerprint to 2.2.17 from 2.2.16:
  > Merge pull request adafruit/Adafruit_CircuitPython_Fingerprint#55 from itsFDavid/compare_with_file

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X to 1.2.0 from 1.1.16:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L1X#20 from TheIllusionist77/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 3.1.5 from 3.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#210 from shubham0x13/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_TemplateEngine to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TemplateEngine#5 from michalpokusa/fixes-and-refactor

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants