-
Notifications
You must be signed in to change notification settings - Fork 18
4upstream #42
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
4upstream #42
Conversation
hiya! thanks so much for submitting a PR! we can review & merge PRs once they have passed continuous integration (CI). that means that code is 'linted' - that means it is formatted and passes basic structure tests, so that we maintain the same text formatting for all new code here is a tutorial on pylint and black: https://learn.adafruit.com/improve-your-code-with-pylint and overall how to contribute PRs to circuitpython: https://learn.adafruit.com/contribute-to-circuitpython-with-git-and-github once you get that green checkmark that indicates CI has passed, please comment reply to this post so we know its time for another review (we may not get notified on CI pass and miss that its time to look!) |
Hm, the log does not tell me why the check failed. |
you need to run
|
Hi, checks from CI are now successful |
@caternuson wanna check it? |
Looks good and generally works: Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> from adafruit_apds9960.apds9960 import APDS9960
>>> apds = APDS9960(board.I2C())
>>> apds.proximity_gain
0
>>> apds.proximity_gain = 3
>>> apds.proximity_gain
3
>>> apds.gesture_gain
2
>>> apds.gesture_gain = 0
>>> apds.gesture_gain
0
>>> @bablokb What do you think about adding a simple dictionary (or similar) to map the gain values, like # set gain to 8x
apds.proximity_gain = 8 It looks like both prox gain and gesture gain have the same general mapping. So could use one for both. And throw a # this should throw an exception
apds.proximity_gain = 100
# and this, since the is no 3x gain
apds.proximity_gain = 3 |
With a dictionary PGAIN and GGAIN would have a different logic than AGAIN (color_gain), unless you want to break existing code. What about adding constants Checking values and throwing ValueErrors is currently not consistent within the library. I will be happy to add that, but there is a footprint tradeoff. So this is more of a policy decision. |
Thanks. Good point about @ladyada lgtm, including the |
thanks :) |
Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS9960 to 3.1.0 from 3.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_APDS9960#42 from bablokb/4upstream > Fixed readthedocs build > Post-patch cleanup Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.4.1 from 4.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#52 from jerryneedell/jerryn_mlc Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.5.6 from 1.5.5: > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#30 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.6.0 from 3.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#35 from whogben/main > Fixed readthedocs build > Consolidate Documentation sections of README Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.12.3 from 1.12.2: > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#54 from masgari/main Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.2.2 from 8.2.1: > Merge pull request adafruit/Adafruit_CircuitPython_BLE#159 from dhalbert/nus-doc-fix Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_LYWSD03MMC to 1.0.6 from 1.0.5: > Fixed readthedocs build Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 2.1.8 from 2.1.7: > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#82 from makermelissa/main > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#81 from makermelissa/main > Fixed readthedocs build Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.3.0 from 5.2.3: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#106 from dgriswo/subscription_logging Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.11.1 from 1.11.0: > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#64 from makermelissa/main Updating https://github.com/adafruit/Adafruit_CircuitPython_WSGI to 1.1.9 from 1.1.8: > Merge pull request adafruit/Adafruit_CircuitPython_WSGI#13 from tekktrik/dev/clearer-bad-return > Fixed readthedocs build > Post-patch cleanup
add getter/setter for proximity-gain (PGAIN) and gesture-gain (GGAIN).